Skip to content
Snippets Groups Projects
Commit 521e76cf authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

warn instead of crashing when logging is not configured

parent 80433126
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@ version = open Beta 1
url = https://my.fqdn/accountmanager
support_email = support@my.fqdn
[log]
[logger]
file = /opt/testidp/IdPAccountManager/log/manager.log
level = info
......
......@@ -41,11 +41,15 @@ sub new {
configuration => $args{configuration},
};
Log::Any::Adapter->set(
'File',
$self->{configuration}->{log}->{file},
log_level => $self->{configuration}->{log}->{level}
);
if ($self->{configuration}->{logger}) {
Log::Any::Adapter->set(
'File',
$self->{configuration}->{log}->{file},
log_level => $self->{configuration}->{log}->{level}
);
} else {
warn "no logger defined in configuration, logging disabled\n";
}
$self->{logger} = Log::Any->get_logger();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment