From 0114ffac3eac5bfff6fbb13ec0115bede9c4d893 Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Thu, 4 Dec 2025 14:26:46 +0100 Subject: [PATCH] chore(config): setup production logging - use stderr in addition to the daily logging channel so the laravel logs are passed to the container logs (docker logs) - use the daily channel with local laravel.log to persist logs to disk for 10 days, ensuring a persistent copy even if the coolify container is removed/ updated - rotate the logs in production every 10 days and only log warnings, to prevent an excessively large laravel.log file - keep LOG_LEVEL=debug for the single channel as it will be used in development --- config/logging.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/logging.php b/config/logging.php index fe9d916b1..68c916474 100644 --- a/config/logging.php +++ b/config/logging.php @@ -53,7 +53,7 @@ return [ 'channels' => [ 'stack' => [ 'driver' => 'stack', - 'channels' => explode(',', (string) env('LOG_STACK', 'single')), + 'channels' => explode(',', (string) env('LOG_STACK', 'stderr,daily')), 'ignore_exceptions' => false, ], @@ -67,14 +67,14 @@ return [ 'daily' => [ 'driver' => 'daily', 'path' => storage_path('logs/laravel.log'), - 'level' => env('LOG_LEVEL', 'debug'), - 'days' => env('LOG_DAILY_DAYS', 14), + 'level' => env('LOG_LEVEL', 'warning'), + 'days' => env('LOG_DAILY_DAYS', 10), 'replace_placeholders' => true, ], 'stderr' => [ 'driver' => 'monolog', - 'level' => env('LOG_LEVEL', 'debug'), + 'level' => env('LOG_LEVEL', 'warning'), 'handler' => StreamHandler::class, 'handler_with' => [ 'stream' => 'php://stderr',