0
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-06-30 10:33:42 +00:00
This commit is contained in:
Dag 2025-06-14 22:45:12 +02:00 committed by GitHub
commit 8c5cd63f07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -31,6 +31,10 @@ timezone = "UTC"
; Display a system message to users.
;message = "Hello world"
; Where to store logs and at which level (debug, info, warning, error)
;log_file_path = "/tmp/rss-bridge.log"
;log_file_level = "info"
; Whether to enable debug mode.
enable_debug_mode = false

View File

@ -52,8 +52,12 @@ $container['logger'] = function () {
} else {
$logger->addHandler(new ErrorLogHandler(Logger::INFO));
}
// Uncomment this for info logging to fs
// $logger->addHandler(new StreamHandler('/tmp/rss-bridge.txt', Logger::INFO));
$path = Configuration::getConfig('system', 'log_file_path');
$level = Configuration::getConfig('system', 'log_file_level');
if ($path && $level) {
$level = array_flip(Logger::LEVEL_NAMES)[strtoupper($level)];
$logger->addHandler(new StreamHandler($path, $level));
}
// Uncomment this for debug logging to fs
// $logger->addHandler(new StreamHandler('/tmp/rss-bridge-debug.txt', Logger::DEBUG));