lighttpd log files

The main log file for this daemon, lighttpd.log, appears to be binary. How would one go about reading it, since cat and vi seem to be the wrong choices?
 
The default log files should be /var/log/lighttpd/access.log and /var/log/lighttpd/error.log, both of them ASCII text. You need to be root or the www user to read them.
 
Had to take a few months to calm down

These kinds of responses are just plain obtuse. And that's my calm answer. Let me explain here with an example:

Code:
[email]root@myserverhere.com[/email] /var/log(4): tail -f lighttpd.log
CLOG��

There IS no /var/log/lighttpd/ directory. The files are:

/var/log/lighttpd.log
/var/log/lighttpd.error.log

Tailing both give me the above output.
 
Whatever your mood, @kpa was right. The sample configuration file for lighttpd (/usr/local/etc/lighttpd/lighttpd.conf.sample) contains /var/log/lighttpd as the root for logging, so that directory should be created, and logging should go in it, even when you decide to rename the log files.

Are the files you mention actually files (in other words, aren't they directories by mistake?), and if they are files, what does file(1) say about them?

Other than that, check your configuration, make sure your var.log_root is actually a directory, or set your server.errorlog and your accesslog.filename directives to full path names, like the ones that are currently unreadable (and move those out of the way). If needed, create them with touch(1) and then chown(8) them to the UID/GID lighttpd runs as (typically www:www).

Here are my directives as an example:

Code:
## where to send error-messages to
server.errorlog             = "/var/log/lighttpd/lighttpd.error.log"

#### accesslog module
accesslog.filename          = "/var/log/lighttpd/lighttpd.access.log"

Result:
Code:
# ls -al /var/log/lighttpd
total 1200
drwx------  2 www   www        512 Aug 13  2012 .
drwxr-xr-x  4 root  wheel     2048 Apr 12 19:00 ..
-rw-r--r--  1 www   www    1155409 Mar 27 20:10 lighttpd.access.log
-rw-r--r--  1 www   www       4474 Mar  5 20:22 lighttpd.error.log

file(1) operations:

Code:
/var/log/lighttpd/lighttpd.access.log: ASCII text, with very long lines
/var/log/lighttpd/lighttpd.error.log: ASCII text

As far as the log format is concerned: it's just as readable as a Squid or an Apache log file. Plain ASCII.
 
Last edited by a moderator:
Back
Top