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
I am trying to incorporate monolog into a non-symfony project. I need to capture the stack trace when an exception is logged.
Thus far it seems that I need to use the NormalizerFormatter instead of the LineFormatter. But I cannot figure out how to do that. Can some please assist? Many thanks in advance.
The text was updated successfully, but these errors were encountered:
You can just call ->setFormatter() on any handler to change it's default formatter. In this case you would need to write your own I think because the normalizer one will just return an array of data so if you output it in a file you'll just get Array as output for every line, not very useful :)
Simply pass the exception as message to the logger, this will call the exception's __toString() and give you a nice formatting including the stack trace.
Hello,
I am trying to incorporate monolog into a non-symfony project. I need to capture the stack trace when an exception is logged.
Thus far it seems that I need to use the
NormalizerFormatter
instead of theLineFormatter
. But I cannot figure out how to do that. Can some please assist? Many thanks in advance.The text was updated successfully, but these errors were encountered: