rfc 上的系统日志问题
我想使用 syslog 从远程应用程序进行日志记录。
不过我有一些问题:
例如 RFC 说:
If the originally formed message has a HOSTNAME field, then it
will contain the hostname as it knows itself. If it does not
have a hostname, then it will contain its own IP address.
这是什么意思? 从我的应用程序到日志记录客户端库的消息,如果它包含某些主机名,那么它将被替换?
能给我举个例子吗?
我尝试过例如:来自本地主机的一些数据
或来自 ahost@aa 的一些数据
这些字符串存储在系统日志服务器中,因为它们是由我的应用程序发送到系统日志客户端库的。
由于上述要求,它们不应该有所不同吗??
我正在使用 log4j 作为 syslog 客户端。
谢谢
I would like to use syslog for logging from a remote application.
I have some questions though:
For example the RFC says:
If the originally formed message has a HOSTNAME field, then it
will contain the hostname as it knows itself. If it does not
have a hostname, then it will contain its own IP address.
What does this mean?
That the message from my application to the logging client library, if it contains some host name then it will be replaced?
Could you please give me an example?
I tried for instance:From localhost some data
orFrom ahost@aa some data
and these strings are stored in syslog server as they were send by my app to the syslog client lib.
Shouldn't they be different as a result of the above req??
I am using log4j for syslog client.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在阅读旧的 RFC 3164。那个已经过时了;替代品是 RFC 5424,它对
中的内容更加清晰HOSTNAME
字段:You're reading the old RFC 3164. That one's obsolete; the replacement is RFC 5424, which is much clearer on what goes in the
HOSTNAME
field: