当我的应用程序只记录一次时,为什么系统日志中会记录重复的错误?
在我们工作的 Solaris 10 服务器(基于 Intel)上,每当应用程序记录错误消息时,它都会在 /var/adm/messages 文件中显示两次。我正在尝试找出如何阻止重复错误。我在我们的开发环境中具有 root 访问权限,因此我可以在那里进行设置。 :) 我很困惑,这可能是 syslog.conf 文件中的一个设置,所以这里是当前内容(删除了标准注释行):
*.err;kern.notice;auth.notice /dev/sysmsg
*.err;kern.debug;daemon.notice;mail.crit /var/adm/messages
*.alert;kern.err;daemon.err operator
*.alert root
*.emerg *
mail.debug ifdef(`LOGHOST', /var/log/syslog, @loghost)
ifdef(`LOGHOST', ,
user.err /dev/sysmsg
user.err /var/adm/messages
user.alert `root, operator'
user.emerg *
)
user.alert 'root, operator'
user.emerg *
auth.info /var/log/authlog
daemon.debug /var/log/connlog
*.info /var/adm/messages
有没有人看到任何可能导致重复错误消息的内容被记录?信息和警告消息被很好地记录(即一次);只有错误消息会被重复。直到我们从 SPARC 硬件切换到 Intel 硬件后,这种情况才发生。哪种类型的应用程序记录错误(Perl 或 Java)似乎并不重要。
戴夫
On our Solaris 10 servers (on Intel) at work, whenever an application logs an error message, it shows up twice in the /var/adm/messages file. I'm trying to figure out how to stop the duplicate error. I have root access in our dev environment, so I can play with settings there. :) I'm ass-u-me'ing that it's maybe a setting in the syslog.conf file, so here are the current contents (with standard comment lines removed):
*.err;kern.notice;auth.notice /dev/sysmsg
*.err;kern.debug;daemon.notice;mail.crit /var/adm/messages
*.alert;kern.err;daemon.err operator
*.alert root
*.emerg *
mail.debug ifdef(`LOGHOST', /var/log/syslog, @loghost)
ifdef(`LOGHOST', ,
user.err /dev/sysmsg
user.err /var/adm/messages
user.alert `root, operator'
user.emerg *
)
user.alert 'root, operator'
user.emerg *
auth.info /var/log/authlog
daemon.debug /var/log/connlog
*.info /var/adm/messages
Does anyone see anything that may be causing the duplicate error messages to be logged? info and warning messages get logged fine (ie, once); only error messages get duplicated. This didn't happen until we switched from SPARC to Intel hardware. It doesn't seem to matter what type of app logs the error (Perl or Java).
Dave
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我昨天很晚才想出来。第二行:
和最后一行:
都将“错误”消息记录到 /var/adm/messages 文件中。我删除了最后一行并将第二行从
*.err;...
更改为*.info;...
,生活很美好。所以它就在那里,一直盯着我的脸。 >:\
戴夫
I figured it out late yesterday. Line two:
and the last line:
were both logging 'error' messages to the /var/adm/messages file. I removed the last line and change the second line from
*.err;...
to*.info;...
and life is good.So it was there, staring me in the face the whole time. >:\
Dave