Logs diferentes para desarrollo

This commit is contained in:
Juan Pablo Vial
2024-12-03 11:39:11 -03:00
parent 606b99a0f9
commit acb1081190
2 changed files with 16 additions and 3 deletions

View File

@ -1,3 +1,5 @@
#ENVIRONMENT=
APP_URL=
MYSQL_HOST=db
@ -9,3 +11,8 @@ MAX_LOGIN_HOURS=120
REDIS_HOST=redis
REDIS_PORT=6379
DB_HOST=db
DB_DATABASE=incoviba
DB_USER=incoviba
DB_PASSWORD=

View File

@ -16,12 +16,18 @@ return [
Monolog\Level::Critical
),
new Monolog\Handler\FilterHandler(
new Monolog\Handler\RedisHandler($container->get(Predis\ClientInterface::class), 'logs:notices'),
($container->has('ENVIRONMENT') and $container->get('ENVIRONMENT') === 'development')
? (new Monolog\Handler\RotatingFileHandler('/logs/notices.log', 10))
->setFormatter(new Monolog\Formatter\LineFormatter(null, null, false, false, true))
: new Monolog\Handler\RedisHandler($container->get(Predis\ClientInterface::class), 'logs:notices'),
Monolog\Level::Notice,
Monolog\Level::Warning
),
new Monolog\Handler\FilterHandler(
(new Incoviba\Common\Implement\Log\MySQLHandler($container->get(Incoviba\Common\Define\Connection::class)))
($container->has('ENVIRONMENT') and $container->get('ENVIRONMENT') === 'development')
? (new Monolog\Handler\RotatingFileHandler('/logs/debug.log', 10))
->setFormatter(new Monolog\Formatter\LineFormatter(null, null, false, false, true))
: (new Incoviba\Common\Implement\Log\MySQLHandler($container->get(Incoviba\Common\Define\Connection::class)))
->setFormatter(new Incoviba\Common\Implement\Log\PDOFormatter()),
Monolog\Level::Debug,
Monolog\Level::Warning