62 parent::__construct(
'Y-m-d\TH:i:s.uP');
78 if ($this->version === self::V1) {
84 return $this->
toJson($message) .
"\n";
89 if (empty($record[
'datetime'])) {
90 $record[
'datetime'] = gmdate(
'c');
93 '@timestamp' => $record[
'datetime'],
94 '@source' => $this->systemName,
97 if (isset($record[
'message'])) {
98 $message[
'@message'] = $record[
'message'];
100 if (isset($record[
'channel'])) {
101 $message[
'@tags'] =
array($record[
'channel']);
102 $message[
'@fields'][
'channel'] = $record[
'channel'];
104 if (isset($record[
'level'])) {
105 $message[
'@fields'][
'level'] = $record[
'level'];
107 if ($this->applicationName) {
110 if (isset($record[
'extra'][
'server'])) {
111 $message[
'@source_host'] = $record[
'extra'][
'server'];
113 if (isset($record[
'extra'][
'url'])) {
114 $message[
'@source_path'] = $record[
'extra'][
'url'];
116 if (!empty($record[
'extra'])) {
117 foreach ($record[
'extra'] as $key => $val) {
118 $message[
'@fields'][$this->extraPrefix . $key] = $val;
121 if (!empty($record[
'context'])) {
122 foreach ($record[
'context'] as $key => $val) {
123 $message[
'@fields'][$this->contextPrefix . $key] = $val;
132 if (empty($record[
'datetime'])) {
133 $record[
'datetime'] = gmdate(
'c');
136 '@timestamp' => $record[
'datetime'],
138 'host' => $this->systemName,
140 if (isset($record[
'message'])) {
141 $message[
'message'] = $record[
'message'];
143 if (isset($record[
'channel'])) {
144 $message[
'type'] = $record[
'channel'];
145 $message[
'channel'] = $record[
'channel'];
147 if (isset($record[
'level_name'])) {
148 $message[
'level'] = $record[
'level_name'];
150 if ($this->applicationName) {
153 if (!empty($record[
'extra'])) {
154 foreach ($record[
'extra'] as $key => $val) {
155 $message[$this->extraPrefix . $key] = $val;
158 if (!empty($record[
'context'])) {
159 foreach ($record[
'context'] as $key => $val) {
160 $message[$this->contextPrefix . $key] = $val;
Create styles array
The data for the language used.
Write to Excel2007 format