DD-WRT:View Logfile in Browser without Local Syslogd (log.sh)


 * View the last 1000 lines from your router's logfile in your browser without a locally running syslogd (i.e. Kiwi)

First Method: Script Generated Live-content
Initial post in German forum: SOLVED: messages (logdatei) formatiert über browser aufrufen)

To use this script you first need to enable syslog on your router without stating an IP. Then the log will be saved in /var/log/messages. You can do this under Administration->Services and then scroll down to the "System Log" section. Click "Enable" and leave "Remote Server" empty. After you saved the script under /tmp/www/ as "log.sh" you must mark it as executable with "chmod +x /tmp/www/log.sh". You can do that by saving the following in your startup script:

To view the log in your browser point it to "http:// /user/log.sh"

It appears that the above method doesn't work under some versions of v24 as shell scripts need to be created in the cgi-bin folder in order for the webserver to execute them.

If you find the previous startup script doesn't work, try the following:

and use  to access it.

Second Method: Static Generated HTML
Note that it is reported that script-generated content will not be delivered by the web server in v24-RC4 and v24-RC5, maybe other versions are affected too (see User-HTML (skript generiert) funzt nicht :( in the German forum). If you just get an empty page if using the first method you may use this workaround:

Save the above code to your startup script and create a cron job for it. To generate a HTML log every 15 minutes you could use this job:

Your router's syslog is now available on  and will be updated every 15 minutes (or whatever you've set in the cron job).