A Monolog based logger that replaces the default logger in Symphony CMS.
This is an extension for Symphony CMS. Add it to the /extensions
folder of your Symphony CMS installation, then enable it though the interface.
$ git clone --depth 1 https://github.com/pointybeard/symext-logger_monolog.git logger_monolog
$ composer update -vv --profile -d ./logger_monolog
After finishing the steps above, enable "Monolog Logger" though the administration interface or, if using Orchestra, with bin/extension enable logger_monolog
.
- Add the following extension defintion to your
.orchestra/build.json
file in the"extensions"
block:
{
"name": "logger_monolog",
"repository": {
"url": "https://github.com/pointybeard/symext-logger_monolog.git"
}
}
- Run the following command to rebuild your Extensions
$ bin/orchestra build \
--skip-import-sections \
--database-skip-import-data \
--database-skip-import-structure \
--skip-create-author \
--skip-seeders \
--skip-git-reset \
--skip-composer \
--skip-postbuild
After installation, enable this logger by going to your System Preferences and choosing "Monolog" from the "Logging" options.
By default, the logging level for the default StreamHandler is WARNING
. To change this, modify your config.json to include the following:
"logger_monolog": {
"level": 100
},
Where level
can be any of the supported logging levels.
By default, the Monolog Logger adds a file stream handler to mimic the standard Symphony log that is created in manifest/logs/
. However, additional handlers can be added by accessing the Monolog Logger instance via Symphony::Log()->getLogger()
. E.g.
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Symphony;
Symphony::Log()->getLogger()->pushHandler(new StreamHandler(
LOGS . "/monolog.errors.log",
Logger::ERROR
));
See the Monolog documentation for more on this.
- This extension works with PHP 7.4 or above.
- Symphony CMS (Extended)
This extension depends on the following Composer libraries:
If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.
We encourage you to contribute to this project. Please check out the Contributing to this project documentation for guidelines about how to get involved.
- Alannah Kearney - https://github.com/pointybeard
- See also the list of contributors who participated in this project
"Monolog Logger Extension for Symphony CMS" is released under the MIT License. See LICENCE for details.