mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-25 23:55:56 +03:00
[GH-ISSUE #296] How can I specify which formatter should be used? #97
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#97
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rmuktader on GitHub (Dec 26, 2013).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/296
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
NormalizerFormatterinstead of theLineFormatter. But I cannot figure out how to do that. Can some please assist? Many thanks in advance.@Seldaek commented on GitHub (Dec 26, 2013):
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 getArrayas output for every line, not very useful :)@staabm commented on GitHub (Dec 26, 2013):
Sounds like the thing you are searching for is
IntrospectionProcessor. I think the issue tracker is not the right place to ask questions...@Fleshgrinder commented on GitHub (Mar 16, 2014):
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.