Tie a filehandle so that whatever is printed to it is instead logged via Log4perl, as recommended by Log::Log4Perl::FAQ, except that using the filehandle you tie as an appender will not cause infinite recursion.
tie *STDERR, 'Tie::Log4perl'; # This will be logged, instead warn "Parbleu, an error!\n";
The following options may be passed to tie after the class name either as a list or as a hash reference.
The level to log at. Defaults to $Log::Log4perl::Level::Debug.
The logger category object log with. Optional.
An optional string to prefix to messages.
Paul Driver <email@example.com>
Copyright (C) 2009 Paul Driver
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.