Created
November 21, 2019 19:51
-
-
Save piotrpog/6da736ead280bd9989173cad05e6ebef to your computer and use it in GitHub Desktop.
Craft CMS log only warning and errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'components' => [ | |
'log' => function() { | |
$config = craft\helpers\App::logConfig(); | |
if ($config) { | |
$config['targets'][0]['includeUserIp'] = false; | |
$config['targets'][0]['logFile'] = '@storage/logs/web.log'; | |
$config['targets'][0]['enableRotation'] = true; | |
$config['targets'][0]['maxFileSize'] = 10240; | |
$config['targets'][0]['maxLogFiles'] = 5; | |
$config['targets'][0]['levels'] = ['error', 'warning']; | |
$config['targets'][0]['logVars'] = []; | |
$config['traceLevel'] = 0; | |
return Craft::createObject($config); | |
} | |
return null; | |
}, | |
], |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment