I am trying to replace a pattern in the log message before it gets logged on to the file. The logger uses the Perl Module Log::Log4perl
. I see that there is only a Filter option available in this module, which does not solve my problem.
Actually, this is what I want to do. Let us say my log messages are "Testing the logger module"
and "Developing the logger module"
. I want to replace the string 'module'
to 'package'
in the message. So, whenever there is a string 'module' in the log message, it should be replaced to 'package' before logging. And I want to use Perl's regex find/replace here, which will allow me to replace different patterns.
Is this possible? Can anyone help?
Thanks in advance,