diff --git a/src/Roastmonday.php b/src/Roastmonday.php index 4655fa2..c8aa562 100644 --- a/src/Roastmonday.php +++ b/src/Roastmonday.php @@ -15,14 +15,19 @@ class Roastmonday extends APnutI public function __construct($config, $pics_root = "", $app_name = 'Roastmonday') { + $log_path = $config['log_file'] ?? __DIR__ . '/../logs/roastmonday.log'; + $use_logrotate = $config['use_logrotate'] ?? false; parent::__construct( $config['client_secret'], $config['client_id'], $config['scope'], $app_name, $config['redirect_url'], - __DIR__ . '/../logs/roastmonday.log', - 'DEBUG' + $log_path, + $config['log_level'], + use_rotating_file_handler: !$use_logrotate, + use_stream_handler: $use_logrotate, + use_syslog_handler: false ); $this->logger->info("App: {$this->app_name}"); $this->pics_root = $pics_root . 'pics/';