php - Override Monolog Handler -
I'm trying to override the MonoG handler browser console handler to customize a few operations, but my custom static The method is not explicitly called. I am red, for the static classes, using inherited classes using static :: should use self for themselves: To call the class method, but temporarily by modifying the base class: my sub method Is not called, is called super method.
I created my custom handler
namespace My bundle \ monol; Use Monolog \ Handler \ BrowserConsoleHandler as BaseBrowserConsoleHandler; Class BrowserConsoleHandler BaseBrowserConsoleHandler {Public Static Function GenerateScript () {// My custom operation is not what is said: [...]
Then I set up my custom handler in a config Added in the form. [Push Handler, [@browser_console_handle]] browser_console_handler: class: MyBundle \ Monolog \ BrowserConsoleHandler
/ Code>
Then I use my logger:
$ logger = $ this- & gt; Obtain ('browser_console_logger'); $ Logger- & gt; Information ('Hello console:', ['af' => 'bar']);
I get my log in the browser console but my sub method is not called ... I am in Dev and my cache is clear. I have not been used much with Symphony (so far ;-), I make some things red on this, but it seems that I'm missing something on the way ...
Comments
Post a Comment