View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006877 | OXID eShop (all versions) | 4. ------ eShop Core ------- | public | 2018-08-08 09:50 | 2024-06-06 09:34 |
Reporter | michael_keiluweit | Assigned To | |||
Priority | normal | Severity | text | Reproducibility | always |
Status | confirmed | Resolution | open | ||
Product Version | 6.1.0 | ||||
Summary | 0006877: Monolog: Documentation != Source Code information mismatch | ||||
Description | Our 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 Reproduce | Put 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 [] [] | ||||
Tags | Exception, Monolog | ||||
Theme | Not defined | ||||
Browser | Not defined | ||||
PHP Version | Not defined | ||||
Database Version | Not defined | ||||
|
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. |
|
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) |