phpvms/config/logging.php

84 lines
2.6 KiB
PHP
Raw Normal View History

2018-02-20 01:09:56 +08:00
<?php
2018-08-27 00:40:04 +08:00
use App\Console\Logger;
2018-02-20 01:09:56 +08: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.
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| 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", "custom", "stack"
|
*/
'channels' => [
'stack' => [
2018-08-27 00:40:04 +08:00
'driver' => 'stack',
'channels' => [
'daily',
2018-08-27 00:40:04 +08:00
// PHP_SAPI === 'cli' ? 'console' : 'daily',
],
],
'cron' => [
2018-08-27 00:40:04 +08:00
'driver' => 'stack',
'channels' => [
'cron_rotating',
'stdout',
],
2018-02-20 01:09:56 +08:00
],
'single' => [
'driver' => 'single',
2018-08-27 00:40:04 +08:00
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
2018-02-20 01:09:56 +08:00
],
'daily' => [
'driver' => 'daily',
2018-08-27 00:40:04 +08:00
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
2018-08-27 00:40:04 +08:00
'days' => 3,
2018-02-20 01:09:56 +08:00
],
'cron_rotating' => [
'driver' => 'daily',
2018-08-27 00:40:04 +08:00
'path' => storage_path('logs/cron.log'),
'level' => env('LOG_LEVEL', 'debug'),
2018-08-27 00:40:04 +08:00
'days' => 3,
],
2018-02-20 01:09:56 +08:00
'slack' => [
2018-08-27 00:40:04 +08:00
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
2018-02-20 01:09:56 +08:00
'username' => 'Laravel Log',
2018-08-27 00:40:04 +08:00
'emoji' => ':boom:',
'level' => 'critical',
2018-02-20 01:09:56 +08:00
],
'stdout' => [
'driver' => 'custom',
'via' => Logger::class,
],
2018-02-20 01:09:56 +08:00
'syslog' => [
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
2018-02-20 01:09:56 +08:00
],
'errorlog' => [
'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'),
2018-02-20 01:09:56 +08:00
],
],
];