in reply to Redirecting STDOUT to file and screen as an afterthought, on Windows.
You can use Log::Log4perl
use Log::Log4perl qw(:easy); Log::Log4perl->easy_init( { level => $DEBUG, file => 'STDOUT', layout => ' - %m%n',}, { level => $DEBUG, file => ">> $0.log"}); DEBUG "$0 started";
|
|---|