Support defined log output
Change-Id: Ibfa5b152c2b7db21c28c2dfe1c247ab5bd47d12e
diff --git a/lib/Kalamar.pm b/lib/Kalamar.pm
index d6623d5..5de4c22 100644
--- a/lib/Kalamar.pm
+++ b/lib/Kalamar.pm
@@ -8,7 +8,7 @@
use List::Util qw!none uniq!;
# Minor version - may be patched from package.json
-our $VERSION = '0.50';
+our $VERSION = '0.51';
# Supported version of Backend API
our $API_VERSION = '1.0';
@@ -102,6 +102,15 @@
$conf = $self->config('Kalamar');
};
+ # Set log file. All precedng logs where send to stderr
+ if ($conf->{log_file}) {
+ Mojo::File->new(Mojo::File->new($conf->{log_file})->dirname)->make_path;
+ $self->log(Mojo::Log->new(
+ path => $conf->{log_file},
+ ));
+ };
+
+
# Check for API endpoint and set the endpoint accordingly
if ($conf->{api}) {