Site icon Hip-Hop Website Design and Development

fluffy.pro. Cheap WordPress maintenance support plans Developer’s blog: Monolog: namespaced logger?

Using monolg library and monolog-cascade extension you can’t configure the “namespaced” loggers. What does it mean? Imagine you have tons of classes and you need to log information from them into a log file. There is nothing special in this. Just define loggers with the needed handler(s) and instantiate them directly in a place where you want them to use with a help of monolog-cascade. It means in your monolog-cascade config file you have to define needed loggers in advance and you have to reference needed loggers by their names. But what if you need an additional logger (with absolutely different handlers/processors) for some of the classes? Will you go through all the classes and change logger names where you instantiate them? I think it doesn’t look like a good idea when a small requirement (for instance, change the log file name for records from a bunch of classes) leads to edits in an application code. It’s something that must be configurable and that’s why I decided to write a tiny library called monolog-cascade-namespaced.Read more »
Source: New feed