Thanks for building this awesome framework. I really enjoy using it.
My app has been in production for a few months right now and i'm facing some debugging issues. When i'm reading logs I can't always know what was the reason of error/warning/notice. There's not enough info logged. Is it possible to log backtrace, request details and some other useful stuff that would help to debug in production?
You can overload the Log class static Initialize() method. Start by copying the existing method. In your overloaded copy, you can change the format string of the line formatter to anything you like, add additional processors, etc.
The default lineformatter has a public method includeStacktraces(), so simply doing $formatter-> includeStacktraces() would be enough to add a stack trace to the log.
For custom logging, you need a custom processor. One of our apps does:
I tried to $formatter->includeStacktraces() but had no success making logs have stacktraces. I even tried to add this line to core/log.php thinking that overloading core class did not work, still no success.
Yes of course i set Monolog version to 1.* in composer.json and updated it. The includeStacktraces method exists but does not work for me, it just does write stacktrace to log.
If the standard functionality doesn't work, you need to create a custom processor, like the one i linked to a few posts back. Then you can wrote to the log whatever you want.