Here's the code I have:
use strict;
use warnings;
use Log::Log4perl qw(:easy);
Log::Log4perl->init({
level => $DEBUG
});
my $logger = Log::Log4perl->get_logger("my.logger");
my $appender = Log::Log4perl::Appender->new("Log::Log4perl::Appender::File",filename => "my.file");
$appender->layout(Log::Log4perl::Layout::SimpleLayout->new);
$logger->add_appender($appender);
$logger->info("this is an info");
all I want to do is log a message to a file, and have the level show up. I understood that is what the SimpleLayout
is for . I'd like to do this without a configuration file.
Running the code above shows the following message:
Log::Log4perl configuration looks suspicious: No loggers defined