Seldaek / monolog

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

How do I use includeStacktraces? #1863

Closed berniedurfee-renaissance closed 4 months ago

berniedurfee-renaissance commented 8 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 4 months ago

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