hypothetical/config/logging.php

133 lines
4.2 KiB
PHP
Raw Permalink Normal View History

2018-03-05 18:45:02 -05:00
<?php
2019-10-31 17:24:53 -04:00
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
2023-05-05 15:31:58 -04:00
use Monolog\Processor\PsrLogMessageProcessor;
2018-03-05 18:45:02 -05:00
return [
/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
2024-03-19 17:11:58 -04:00
| This option defines the default log channel that is utilized to write
| messages to your logs. The value provided here should match one of
| the channels present in the list of "channels" configured below.
2018-03-05 18:45:02 -05:00
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
2022-05-23 21:01:33 -04:00
/*
|--------------------------------------------------------------------------
| Deprecations Log Channel
|--------------------------------------------------------------------------
|
| This option controls the log channel that should be used to log warnings
| regarding deprecated PHP and library features. This allows you to get
| your application ready for upcoming major versions of dependencies.
|
*/
'deprecations' => [
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
2024-03-19 17:11:58 -04:00
'trace' => env('LOG_DEPRECATIONS_TRACE', false),
2022-05-23 21:01:33 -04:00
],
2018-03-05 18:45:02 -05:00
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
2024-03-19 17:11:58 -04:00
| Here you may configure the log channels for your application. Laravel
| utilizes the Monolog PHP logging library, which includes a variety
| of powerful log handlers and formatters that you're free to use.
2018-03-05 18:45:02 -05:00
|
2024-06-10 16:15:14 -04:00
| Available drivers: "single", "daily", "slack", "syslog",
2024-03-19 17:11:58 -04:00
| "errorlog", "monolog", "custom", "stack"
2018-03-05 18:45:02 -05:00
|
*/
'channels' => [
2024-03-19 17:11:58 -04:00
2018-03-05 18:45:02 -05:00
'stack' => [
'driver' => 'stack',
2024-03-19 17:11:58 -04:00
'channels' => explode(',', env('LOG_STACK', 'single')),
2019-03-19 17:40:13 -04:00
'ignore_exceptions' => false,
2018-03-05 18:45:02 -05:00
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
2023-05-05 15:31:58 -04:00
'replace_placeholders' => true,
2018-03-05 18:45:02 -05:00
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
2024-03-19 17:11:58 -04:00
'days' => env('LOG_DAILY_DAYS', 14),
2023-05-05 15:31:58 -04:00
'replace_placeholders' => true,
2018-03-05 18:45:02 -05:00
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
2024-03-19 17:11:58 -04:00
'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
'emoji' => env('LOG_SLACK_EMOJI', ':boom:'),
'level' => env('LOG_LEVEL', 'critical'),
2023-05-05 15:31:58 -04:00
'replace_placeholders' => true,
2018-03-05 18:45:02 -05:00
],
'papertrail' => [
2019-03-19 17:40:13 -04:00
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
2022-05-23 21:01:33 -04:00
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
2022-05-23 21:01:33 -04:00
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
],
2023-05-05 15:31:58 -04:00
'processors' => [PsrLogMessageProcessor::class],
],
'stderr' => [
'driver' => 'monolog',
2021-04-20 17:11:13 -04:00
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class,
2019-03-19 17:40:13 -04:00
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'stream' => 'php://stderr',
],
2023-05-05 15:31:58 -04:00
'processors' => [PsrLogMessageProcessor::class],
],
2018-03-05 18:45:02 -05:00
'syslog' => [
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
2024-03-19 17:11:58 -04:00
'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER),
2023-05-05 15:31:58 -04:00
'replace_placeholders' => true,
2018-03-05 18:45:02 -05:00
],
'errorlog' => [
'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'),
2023-05-05 15:31:58 -04:00
'replace_placeholders' => true,
2018-03-05 18:45:02 -05:00
],
2019-10-31 17:24:53 -04:00
'null' => [
'driver' => 'monolog',
'handler' => NullHandler::class,
],
'emergency' => [
'path' => storage_path('logs/laravel.log'),
],
2024-03-19 17:11:58 -04:00
2018-03-05 18:45:02 -05:00
],
];