Where to put debug log files for my daemon application?

I use C and Linux as my programming platform.

I am learning how to create a daemon, and I want to create a log file to write a debug message in my daemon. My question is: where should I put the log file on my system. Should I put it in the var folder?

Please advice.

Many thanks.

+6
c linux
source share
3 answers

You should use syslog and let the administrator decide where the log is being written.

+6
source share

/var/log/{app name} I think this is the default location.

+3
source share

This is probably a matter of taste, but /var/log/ or /etc/log/ sounds reasonable to me. You should also consider using syslog (see http://linux.die.net/man/3/syslog ).

+3
source share

All Articles