PhyrePanel-mirror/web/config/logging.php

133 lines
4.3 KiB
PHP
Raw Permalink Normal View History

2024-04-22 11:14:05 +00:00
<?php
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
use Monolog\Processor\PsrLogMessageProcessor;
2024-05-10 16:01:21 +00:00
use App\PhyreConfig;
2024-04-22 11:14:05 +00:00
return [
/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
| This option defines the default log channel that gets used when writing
| messages to the logs. The name specified in this option should match
| one of the channels defined in the "channels" configuration array.
|
*/
2024-05-10 16:01:21 +00:00
'default' => PhyreConfig::get('LOG_CHANNEL', 'stack'),
2024-04-22 11:14:05 +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' => [
2024-05-10 16:01:21 +00:00
'channel' => PhyreConfig::get('LOG_DEPRECATIONS_CHANNEL', 'null'),
2024-04-22 11:14:05 +00:00
'trace' => false,
],
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog",
| "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single'],
'ignore_exceptions' => false,
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
2024-05-10 16:01:21 +00:00
'level' => PhyreConfig::get('LOG_LEVEL', 'debug'),
2024-04-22 11:14:05 +00:00
'replace_placeholders' => true,
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
2024-05-10 16:01:21 +00:00
'level' => PhyreConfig::get('LOG_LEVEL', 'debug'),
2024-04-22 11:14:05 +00:00
'days' => 14,
'replace_placeholders' => true,
],
'slack' => [
'driver' => 'slack',
2024-05-10 16:01:21 +00:00
'url' => PhyreConfig::get('LOG_SLACK_WEBHOOK_URL'),
2024-04-22 11:14:05 +00:00
'username' => 'Laravel Log',
'emoji' => ':boom:',
2024-05-10 16:01:21 +00:00
'level' => PhyreConfig::get('LOG_LEVEL', 'critical'),
2024-04-22 11:14:05 +00:00
'replace_placeholders' => true,
],
'papertrail' => [
'driver' => 'monolog',
2024-05-10 16:01:21 +00:00
'level' => PhyreConfig::get('LOG_LEVEL', 'debug'),
'handler' => PhyreConfig::get('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
2024-04-22 11:14:05 +00:00
'handler_with' => [
2024-05-10 16:01:21 +00:00
'host' => PhyreConfig::get('PAPERTRAIL_URL'),
'port' => PhyreConfig::get('PAPERTRAIL_PORT'),
'connectionString' => 'tls://'.PhyreConfig::get('PAPERTRAIL_URL').':'.PhyreConfig::get('PAPERTRAIL_PORT'),
2024-04-22 11:14:05 +00:00
],
'processors' => [PsrLogMessageProcessor::class],
],
'stderr' => [
'driver' => 'monolog',
2024-05-10 16:01:21 +00:00
'level' => PhyreConfig::get('LOG_LEVEL', 'debug'),
2024-04-22 11:14:05 +00:00
'handler' => StreamHandler::class,
2024-05-10 16:01:21 +00:00
'formatter' => PhyreConfig::get('LOG_STDERR_FORMATTER'),
2024-04-22 11:14:05 +00:00
'with' => [
'stream' => 'php://stderr',
],
'processors' => [PsrLogMessageProcessor::class],
],
'syslog' => [
'driver' => 'syslog',
2024-05-10 16:01:21 +00:00
'level' => PhyreConfig::get('LOG_LEVEL', 'debug'),
2024-04-22 11:14:05 +00:00
'facility' => LOG_USER,
'replace_placeholders' => true,
],
'errorlog' => [
'driver' => 'errorlog',
2024-05-10 16:01:21 +00:00
'level' => PhyreConfig::get('LOG_LEVEL', 'debug'),
2024-04-22 11:14:05 +00:00
'replace_placeholders' => true,
],
'null' => [
'driver' => 'monolog',
'handler' => NullHandler::class,
],
'emergency' => [
'path' => storage_path('logs/laravel.log'),
],
],
];