开发者

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

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 开发者_JAVA百科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.


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


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜