View Issue Details

IDProjectCategoryView StatusLast Update
0006877OXID eShop (all versions)4. ------ eShop Core -------public2018-08-30 10:30
Reportermichael_keiluweit Assigned To 
PrioritynormalSeveritytextReproducibilityalways
Status acknowledgedResolutionopen 
Product Version6.1.0 
Summary0006877: Monolog: Documentation != Source Code information mismatch
DescriptionOur documentation states that the logger writes into a file starting from log level 'warning'.
All messages of log level warning or higher will be written to :file:`source/log/oxideshop.log`.

Source: https://github.com/OXID-eSales/developer_documentation/blob/b-6.1/system_architecture/logging.rst#configuration-and-extension

However the file config.inc.php initialise the log level with 'error'. So will the Handler be initiated. The result: warnings will not be logged into a file and disappear into to the oblivion (since no handler is registered for the level 'warning').
Source: https://github.com/OXID-eSales/oxideshop_ce/blob/master/source/config.inc.php.dist#L190

Either we change the log level in config.inc.php to "warning" or we adapt the documentation.
Steps To ReproducePut the following code into the file index.php and call the shop. Check the log file in log/oxideshop.log

$logger = \OxidEsales\Eshop\Core\Registry::getLogger();
$logger->warning('warning message');
$logger->error('error message');


Expected:
[2018-08-08 09:52:37] OXID Logger.WARNING: warning message [] []
[2018-08-08 09:52:37] OXID Logger.ERROR: error message [] []


Got:
[2018-08-08 09:52:37] OXID Logger.ERROR: error message [] []
TagsException, Monolog
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
Database VersionNot defined

Activities

robert blank

2018-08-29 12:06

reporter   ~0012593

As we already log some stuff to the "warning" level in the shop shop code, "warning" should IMHO also be set as default level in config.inc.php.dist.
Sadly people with existing v6.1 installations would have to adapt their config.inc.php manually.

michael_keiluweit

2018-08-30 10:30

administrator   ~0012595

maybe this line must also be changed: https://github.com/OXID-eSales/oxideshop_ce/blob/master/source/Internal/Logger/Configuration/MonologConfiguration.php#L35 (MonologConfiguration::$defaultLogLevel)