Closed VadimIzmalkov closed 6 years ago
In that case, you can setup your log config to set "formatter"'s dateTimeFormat with the following under "options" in db writers config:
// config/autoload/error-hero-module.local.php
'log' => [
'ErrorHeroModuleLogger' => [
'writers' => [
[
'name' => 'db',
'options' => [
// ... current config
'formatter' => [
'name' => 'db',
'options' => [
'dateTimeFormat' => 'Y-m-d H:i:s',
],
],
// ...
],
],
],
],
],
Thanks, it works for me
What ZF application I'm using when issue happen ?
What PHP version you're using?
What ErrorHeroModule version you're using?
Expected behavior
Write logs to database.
Actual behavior
Nothing happens in database once bug has been occured.
Explanation
Method $this->getDateTimeFormat() https://github.com/samsonasik/ErrorHeroModule/blob/master/src/Handler/Formatter/Json.php#L26 return timestamp in "c" format 2004-02-12T15:19:21+00:00 . On my preset Mysql requires "Y-m-d H:i:s"
Workaround
Change type of 'date' to text