mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-08-10 23:31:21 +02:00
fix: Logger default WARNING→INFO + structured PeerTube logging
Log level: production default was Level::Warning, but all facades
(AppLogger, AdminLogger, Audit) write at Monolog INFO level. This
silently discarded submission, admin action, and audit logs when
LOG_LEVEL env var was unset. Changed to Level::Info.
PeerTube: replaced raw error_log() calls in PeerTubeService::upload(),
deleteVideo(), FilepondHandler::process(), ThesisCreateController,
and ThesisFileHandler with structured logging:
- Successes → Logger::get('app')->info() (visible in App — soumissions tab)
- Failures → ErrorHandler::log('peertube_*', ...) (visible in Erreurs tab)
Added require_once for Logger and ErrorHandler in PeerTubeService.
This commit is contained in:
+7
-2
@@ -79,14 +79,19 @@ class Logger
|
||||
|
||||
/**
|
||||
* Read the LOG_LEVEL env var with sensible defaults.
|
||||
*
|
||||
* All facades (AppLogger, AdminLogger, Audit) write at INFO level,
|
||||
* so the production default must be at least INFO — otherwise
|
||||
* submission logs, admin action logs, and audit traces are silently
|
||||
* discarded.
|
||||
*/
|
||||
private static function level(): Level
|
||||
{
|
||||
$level = strtoupper(getenv('LOG_LEVEL') ?: '');
|
||||
|
||||
// Default: WARNING in production (always set in .env), DEBUG otherwise
|
||||
// Default: INFO in production, DEBUG in dev (cli-server)
|
||||
if ($level === '') {
|
||||
return php_sapi_name() === 'cli-server' ? Level::Debug : Level::Warning;
|
||||
return php_sapi_name() === 'cli-server' ? Level::Debug : Level::Info;
|
||||
}
|
||||
|
||||
return Level::fromName($level);
|
||||
|
||||
Reference in New Issue
Block a user