Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to place a debug log files for my daemon app?

Tags:

c

linux

I am using C language and Linux as my programming platform.

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

Please advice.

Many thanks.

like image 898
domlao Avatar asked Jun 18 '10 06:06

domlao


3 Answers

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

like image 161
R Samuel Klatchko Avatar answered Nov 09 '22 14:11

R Samuel Klatchko


/var/log/{app name} I believe is the standard location.

like image 3
Nathan Osman Avatar answered Nov 09 '22 15:11

Nathan Osman


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).

like image 3
Greg S Avatar answered Nov 09 '22 16:11

Greg S