/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/Log/Formatter
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/Log/Formatter/JsonFormatter.php (1527B)
*/
protected $_defaultConfig = [
'dateFormat' => DATE_ATOM,
'flags' => JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES,
'appendNewline' => true,
];
/**
* @param array
$config Formatter config
*/
public function __construct(array $config = [])
{
$this->setConfig($config);
}
/**
* @inheritDoc
*/
public function format($level, string $message, array $context = []): string
{
$log = ['date' => date($this->_config['dateFormat']), 'level' => (string)$level, 'message' => $message];
$json = json_encode($log, $this->_config['flags']);
return $this->_config['appendNewline'] ? $json . "\n" : $json;
}
}