Seldaek / monolog

Sends your logs to files, sockets, inboxes, databases and various web services
https://seldaek.github.io/monolog/
MIT License
21.05k stars 1.9k forks source link

How do I use includeStacktraces? #1863

Closed berniedurfee-renaissance closed 7 months ago

berniedurfee-renaissance commented 11 months ago

Monolog version 2.5

I don't see any docs on how to use includeStacktraces. Do I add the exception to the log context and it logs the stacktrace there?

I'm using the JSON formatter.

Seldaek commented 7 months ago

Yes, ['exception' => $e] in context and then ->includeStacktraces(true) on the formatter should output full stack traces.