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
Branches
Tags
No related merge requests found
...@@ -19,7 +19,7 @@ version = open Beta 1 ...@@ -19,7 +19,7 @@ version = open Beta 1
url = https://my.fqdn/accountmanager url = https://my.fqdn/accountmanager
support_email = support@my.fqdn support_email = support@my.fqdn
[log] [logger]
file = /opt/testidp/IdPAccountManager/log/manager.log file = /opt/testidp/IdPAccountManager/log/manager.log
level = info level = info
......
...@@ -41,11 +41,15 @@ sub new { ...@@ -41,11 +41,15 @@ sub new {
configuration => $args{configuration}, configuration => $args{configuration},
}; };
Log::Any::Adapter->set( if ($self->{configuration}->{logger}) {
'File', Log::Any::Adapter->set(
$self->{configuration}->{log}->{file}, 'File',
log_level => $self->{configuration}->{log}->{level} $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(); $self->{logger} = Log::Any->get_logger();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment