You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the monolog makes use of the channel specified when initializing the Logger Class. Is there a way to dynamically specify the channel information.
There isn't a method setName on the Logger class and $name is a protected property so cannot actually change the channel name dynamically.
My application initializes the Logger class globally and makes use of that instance to Log throughout the application, so it is actually difficult to change the channel name.
I was thinking of something like this
$loggerObj->setName('CHANNEL_NAME');
$loggerObj->addInfo('LOG INFORMATION GOES HERE');
or
$loggerObj->addInfo('LOG INFO GOES HERE',$context,$channelName);
Could someone advice if there is a way to do this?
The text was updated successfully, but these errors were encountered:
That would cause bad side-effects and messy code since you would have to change the channel back to the previous value every time. The point is you can create multiple Loggers for each logical channel you have, and then add all the same handlers to each of them.
Currently the monolog makes use of the channel specified when initializing the Logger Class. Is there a way to dynamically specify the channel information.
There isn't a method
setName
on the Logger class and$name
is a protected property so cannot actually change the channel name dynamically.My application initializes the Logger class globally and makes use of that instance to Log throughout the application, so it is actually difficult to change the channel name.
I was thinking of something like this
or
$loggerObj->addInfo('LOG INFO GOES HERE',$context,$channelName);
Could someone advice if there is a way to do this?
The text was updated successfully, but these errors were encountered: