Log4Perl bundling logging from several programs into one log

萝らか妹 提交于 2019-12-12 14:50:05

问题


Is there any Logger on CPAN which allows me to bundle logs from several programs into one file with synchronising parallel logging when two programs run the same time and call log4Perl in parallel.
Background is that I use a custom appender which writes Emails and I would like to bundle all emails in a single file as a backup in case the mail server has problems.


回答1:


You can do that in two main ways:

  • with Log::Log4perl::Appender::File (and its descendants) with the 'syswrite' option, which guarantees atomic writes, and
  • with Log::Log4perl::Appender::Synchronized.


来源:https://stackoverflow.com/questions/3180752/log4perl-bundling-logging-from-several-programs-into-one-log

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!