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.