# lighttpd log files



## islandwifibill (May 28, 2012)

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?


----------



## SirDice (May 29, 2012)

I've never used www/lighttpd but I doubt the logging is in binary. As far as I know it's plain old ASCII.


----------



## kpa (May 29, 2012)

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.


----------



## islandwifibill (Apr 12, 2013)

*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:


```
[email]root@myserverhere.com[/email] /var/log(4): tail -f lighttpd.log
CLOGï¿½ï¿½
```

There IS no /var/log/lighttpd/ directory. *T*he files are:

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

Tailing both give me the above output.


----------



## DutchDaemon (Apr 12, 2013)

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:


```
## 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:

```
# 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:


```
/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.


----------



## kpa (Apr 12, 2013)

I don't use www/lighttpd anymore but those paths I refered to were the defaults for the log files at the time I was using it.


----------

