hmmmmm
This commit is contained in:
parent
a5e54e9f5b
commit
c29e09ccc0
6 changed files with 378 additions and 4 deletions
95
config/packages/monolog.php
Normal file
95
config/packages/monolog.php
Normal file
|
@ -0,0 +1,95 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$containerConfigurator->extension('monolog', [
|
||||
'channels' => [
|
||||
'deprecation',
|
||||
],
|
||||
]);
|
||||
if ($containerConfigurator->env() === 'dev') {
|
||||
$containerConfigurator->extension('monolog', [
|
||||
'handlers' => [
|
||||
'main' => [
|
||||
'type' => 'stream',
|
||||
'path' => '%kernel.logs_dir%/%kernel.environment%.log',
|
||||
'level' => 'debug',
|
||||
'channels' => [
|
||||
'!event',
|
||||
],
|
||||
],
|
||||
'console' => [
|
||||
'type' => 'console',
|
||||
'process_psr_3_messages' => false,
|
||||
'channels' => [
|
||||
'!event',
|
||||
'!doctrine',
|
||||
'!console',
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
}
|
||||
if ($containerConfigurator->env() === 'test') {
|
||||
$containerConfigurator->extension('monolog', [
|
||||
'handlers' => [
|
||||
'main' => [
|
||||
'type' => 'fingers_crossed',
|
||||
'action_level' => 'error',
|
||||
'handler' => 'nested',
|
||||
'excluded_http_codes' => [
|
||||
404,
|
||||
405,
|
||||
],
|
||||
'channels' => [
|
||||
'!event',
|
||||
],
|
||||
],
|
||||
'nested' => [
|
||||
'type' => 'stream',
|
||||
'path' => '%kernel.logs_dir%/%kernel.environment%.log',
|
||||
'level' => 'debug',
|
||||
],
|
||||
],
|
||||
]);
|
||||
}
|
||||
if ($containerConfigurator->env() === 'prod') {
|
||||
$containerConfigurator->extension('monolog', [
|
||||
'handlers' => [
|
||||
'main' => [
|
||||
'type' => 'fingers_crossed',
|
||||
'action_level' => 'error',
|
||||
'handler' => 'nested',
|
||||
'excluded_http_codes' => [
|
||||
404,
|
||||
405,
|
||||
],
|
||||
'buffer_size' => 50,
|
||||
],
|
||||
'nested' => [
|
||||
'type' => 'stream',
|
||||
'path' => 'php://stderr',
|
||||
'level' => 'debug',
|
||||
'formatter' => 'monolog.formatter.json',
|
||||
],
|
||||
'console' => [
|
||||
'type' => 'console',
|
||||
'process_psr_3_messages' => false,
|
||||
'channels' => [
|
||||
'!event',
|
||||
'!doctrine',
|
||||
],
|
||||
],
|
||||
'deprecation' => [
|
||||
'type' => 'stream',
|
||||
'channels' => [
|
||||
'deprecation',
|
||||
],
|
||||
'path' => 'php://stderr',
|
||||
'formatter' => 'monolog.formatter.json',
|
||||
],
|
||||
],
|
||||
]);
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue