Open cluwong opened 3 years ago
There is no config to generate a stack trace. Even if we were to add such capability, I think it would not be useful because any stack trace obtained in this library will only give you the stack at the point of logging the message. What you really want is the stack at the point of failure. You could do something like this in your code:
try {
doSomething();
} catch(\Exception $e) {
\Yii::error([
"exception_message" => $e->getMessage(),
"stack" => $e->getTraceAsString(),
]);
}
However, that will only give you the stack trace from the point of doSomething()
not where the exception actually occurred.
When there's exception errors, there are no stack trace information where the error comes from.
Can this be set in config somewhere? Or be enhanced to include such feature?