Compare commits

..

1 Commits

Author SHA1 Message Date
db9a0a6d8c added support for logrotate, fox #5 2025-05-26 13:12:15 +02:00

View File

@ -15,14 +15,19 @@ class Roastmonday extends APnutI
public function __construct($config, $pics_root = "", $app_name = 'Roastmonday') 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( parent::__construct(
$config['client_secret'], $config['client_secret'],
$config['client_id'], $config['client_id'],
$config['scope'], $config['scope'],
$app_name, $app_name,
$config['redirect_url'], $config['redirect_url'],
__DIR__ . '/../logs/roastmonday.log', $log_path,
'DEBUG' $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->logger->info("App: {$this->app_name}");
$this->pics_root = $pics_root . 'pics/'; $this->pics_root = $pics_root . 'pics/';