在哪里为我的守护程序放置调试日志文件? [英] Where to place a debug log files for my daemon app?

查看:32
本文介绍了在哪里为我的守护程序放置调试日志文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C语言和Linux作为编程平台.

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

我正在学习如何创建一个守护进程,我想创建一个日志文件,以便在我的守护进程中写入调试消息.我的问题是我应该将日志文件放在系统中的什么位置.我应该把它放在var文件夹中吗?

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?

请咨询.

非常感谢.

推荐答案

您应使用 syslog ,并让管理员确定日志的写入位置.

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

这篇关于在哪里为我的守护程序放置调试日志文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆