clrghouz/config/logging.php

133 lines
4.2 KiB
PHP
Raw Permalink Normal View History

2018-11-15 10:45:49 +00:00
<?php
2021-05-03 12:53:40 +00:00
use Monolog\Handler\NullHandler;
2018-11-15 10:45:49 +00:00
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
2024-11-04 07:25:49 +00:00
use Monolog\Processor\PsrLogMessageProcessor;
2018-11-15 10:45:49 +00:00
return [
/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
2024-11-04 07:25:49 +00: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-11-15 10:45:49 +00:00
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
2024-11-04 07:25:49 +00: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'),
'trace' => env('LOG_DEPRECATIONS_TRACE', false),
],
2018-11-15 10:45:49 +00:00
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
2024-11-04 07:25:49 +00: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-11-15 10:45:49 +00:00
|
2024-11-04 07:25:49 +00:00
| Available drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog", "custom", "stack"
2018-11-15 10:45:49 +00:00
|
*/
'channels' => [
2024-11-04 07:25:49 +00:00
2018-11-15 10:45:49 +00:00
'stack' => [
'driver' => 'stack',
2024-11-04 07:25:49 +00:00
'channels' => explode(',', env('LOG_STACK', 'single')),
2021-05-03 12:53:40 +00:00
'ignore_exceptions' => false,
2018-11-15 10:45:49 +00:00
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
2021-05-03 12:53:40 +00:00
'level' => env('LOG_LEVEL', 'debug'),
2024-11-04 07:25:49 +00:00
'replace_placeholders' => true,
2018-11-15 10:45:49 +00:00
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
2021-05-03 12:53:40 +00:00
'level' => env('LOG_LEVEL', 'debug'),
2024-11-04 07:25:49 +00:00
'days' => env('LOG_DAILY_DAYS', 14),
'replace_placeholders' => true,
2018-11-15 10:45:49 +00:00
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
2024-11-04 07:25:49 +00:00
'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
'emoji' => env('LOG_SLACK_EMOJI', ':boom:'),
2021-05-03 12:53:40 +00:00
'level' => env('LOG_LEVEL', 'critical'),
2024-11-04 07:25:49 +00:00
'replace_placeholders' => true,
2018-11-15 10:45:49 +00:00
],
'papertrail' => [
2021-05-03 12:53:40 +00:00
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
2024-11-04 07:25:49 +00:00
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
2018-11-15 10:45:49 +00:00
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
2024-11-04 07:25:49 +00:00
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
2018-11-15 10:45:49 +00:00
],
2024-11-04 07:25:49 +00:00
'processors' => [PsrLogMessageProcessor::class],
2018-11-15 10:45:49 +00:00
],
'stderr' => [
'driver' => 'monolog',
2021-05-03 12:53:40 +00:00
'level' => env('LOG_LEVEL', 'debug'),
2018-11-15 10:45:49 +00:00
'handler' => StreamHandler::class,
2021-05-03 12:53:40 +00:00
'formatter' => env('LOG_STDERR_FORMATTER'),
2018-11-15 10:45:49 +00:00
'with' => [
'stream' => 'php://stderr',
],
2024-11-04 07:25:49 +00:00
'processors' => [PsrLogMessageProcessor::class],
2018-11-15 10:45:49 +00:00
],
'syslog' => [
'driver' => 'syslog',
2021-05-03 12:53:40 +00:00
'level' => env('LOG_LEVEL', 'debug'),
2024-11-04 07:25:49 +00:00
'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER),
'replace_placeholders' => true,
2018-11-15 10:45:49 +00:00
],
'errorlog' => [
'driver' => 'errorlog',
2021-05-03 12:53:40 +00:00
'level' => env('LOG_LEVEL', 'debug'),
2024-11-04 07:25:49 +00:00
'replace_placeholders' => true,
2021-05-03 12:53:40 +00:00
],
'null' => [
'driver' => 'monolog',
'handler' => NullHandler::class,
],
'emergency' => [
'path' => storage_path('logs/laravel.log'),
2018-11-15 10:45:49 +00:00
],
2024-11-04 07:25:49 +00:00
2018-11-15 10:45:49 +00:00
],
];