Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以让一个应用程序同时写入多个系统日志设施?
我有一个用 C/C++ 编写的应用程序,我想将一些消息写入 local0 并将其他消息写入 local1。我不希望 local0 的消息出现在 local1 中,反之亦然。
查看手册页syslog,我看到了这个例子:
syslog
syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m");
做
syslog(LOG_INFO|LOG_LOCAL0, "message for local0"); syslog(LOG_INFO|LOG_LOCAL1, "message for local1");
工作?
你不能在一个电话中做到这一点。您必须为每个设施打电话。