ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Encodes whatever record data is passed to it as json. More...
Public Member Functions | ||||
__construct ($batchMode=self::BATCH_MODE_JSON, $appendNewline=true) | ||||
getBatchMode () | ||||
The batch mode option configures the formatting style for multiple records. More... | ||||
isAppendingNewlines () | ||||
True if newlines are appended to every formatted record. More... | ||||
format (array $record) | ||||
{Formats a log record.
| ||||
formatBatch (array $records) | ||||
{Formats a set of log records.
| ||||
includeStacktraces ($include=true) | ||||
Public Member Functions inherited from Monolog\Formatter\NormalizerFormatter | ||||
__construct ($dateFormat=null) | ||||
format (array $record) | ||||
{Formats a log record.
| ||||
formatBatch (array $records) | ||||
{Formats a set of log records.
| ||||
detectAndCleanUtf8 (&$data) | ||||
Detect invalid UTF-8 string characters and convert to valid UTF-8. More... | ||||
Data Fields | |
const | BATCH_MODE_JSON = 1 |
const | BATCH_MODE_NEWLINES = 2 |
Data Fields inherited from Monolog\Formatter\NormalizerFormatter | |
const | SIMPLE_DATE = "Y-m-d H:i:s" |
Protected Member Functions | |
formatBatchJson (array $records) | |
Return a JSON-encoded array of records. More... | |
formatBatchNewlines (array $records) | |
Use new lines to separate records instead of a JSON-encoded array. More... | |
normalize ($data) | |
Normalizes given $data. More... | |
normalizeException ($e) | |
Normalizes given exception with or without its own stack trace based on includeStacktraces property. More... | |
Protected Member Functions inherited from Monolog\Formatter\NormalizerFormatter | |
normalize ($data) | |
normalizeException ($e) | |
toJson ($data, $ignoreErrors=false) | |
Return the JSON representation of a value. More... | |
Protected Attributes | |
$batchMode | |
$appendNewline | |
$includeStacktraces = false | |
Protected Attributes inherited from Monolog\Formatter\NormalizerFormatter | |
$dateFormat | |
Encodes whatever record data is passed to it as json.
This can be useful to log to databases or remote APIs
Definition at line 23 of file JsonFormatter.php.
Monolog\Formatter\JsonFormatter::__construct | ( | $batchMode = self::BATCH_MODE_JSON , |
|
$appendNewline = true |
|||
) |
int | $batchMode |
Definition at line 38 of file JsonFormatter.php.
References Monolog\Formatter\JsonFormatter\$appendNewline, and Monolog\Formatter\JsonFormatter\$batchMode.
Monolog\Formatter\JsonFormatter::format | ( | array | $record | ) |
{Formats a log record.
array | $record | A record to format |
Implements Monolog\Formatter\FormatterInterface.
Definition at line 71 of file JsonFormatter.php.
References Monolog\Formatter\JsonFormatter\normalize(), and Monolog\Formatter\NormalizerFormatter\toJson().
Monolog\Formatter\JsonFormatter::formatBatch | ( | array | $records | ) |
{Formats a set of log records.
array | $records | A set of records to format |
Implements Monolog\Formatter\FormatterInterface.
Definition at line 79 of file JsonFormatter.php.
References Monolog\Formatter\JsonFormatter\formatBatchJson(), and Monolog\Formatter\JsonFormatter\formatBatchNewlines().
|
protected |
Return a JSON-encoded array of records.
array | $records |
Definition at line 105 of file JsonFormatter.php.
References Monolog\Formatter\JsonFormatter\normalize(), and Monolog\Formatter\NormalizerFormatter\toJson().
Referenced by Monolog\Formatter\JsonFormatter\formatBatch().
|
protected |
Use new lines to separate records instead of a JSON-encoded array.
array | $records |
Definition at line 117 of file JsonFormatter.php.
References Monolog\Formatter\JsonFormatter\$appendNewline, and $key.
Referenced by Monolog\Formatter\JsonFormatter\formatBatch().
Monolog\Formatter\JsonFormatter::getBatchMode | ( | ) |
The batch mode option configures the formatting style for multiple records.
By default, multiple records will be formatted as a JSON-encoded array. However, for compatibility with some API endpoints, alternative styles are available.
Definition at line 53 of file JsonFormatter.php.
References Monolog\Formatter\JsonFormatter\$batchMode.
Monolog\Formatter\JsonFormatter::includeStacktraces | ( | $include = true | ) |
bool | $include |
Definition at line 94 of file JsonFormatter.php.
Referenced by Monolog\Formatter\JsonFormatter\normalizeException().
Monolog\Formatter\JsonFormatter::isAppendingNewlines | ( | ) |
True if newlines are appended to every formatted record.
Definition at line 63 of file JsonFormatter.php.
References Monolog\Formatter\JsonFormatter\$appendNewline.
|
protected |
Normalizes given $data.
mixed | $data |
Definition at line 138 of file JsonFormatter.php.
References $data, $key, array, and Monolog\Formatter\JsonFormatter\normalizeException().
Referenced by Monolog\Formatter\JsonFormatter\format(), Monolog\Formatter\JsonFormatter\formatBatchJson(), and Monolog\Formatter\JsonFormatter\normalizeException().
|
protected |
Normalizes given exception with or without its own stack trace based on includeStacktraces
property.
Exception | Throwable | $e |
Definition at line 170 of file JsonFormatter.php.
References $data, array, Monolog\Formatter\JsonFormatter\includeStacktraces(), and Monolog\Formatter\JsonFormatter\normalize().
Referenced by Monolog\Formatter\JsonFormatter\normalize().
|
protected |
Definition at line 29 of file JsonFormatter.php.
Referenced by Monolog\Formatter\LogglyFormatter\__construct(), Monolog\Formatter\JsonFormatter\__construct(), Monolog\Formatter\JsonFormatter\formatBatchNewlines(), and Monolog\Formatter\JsonFormatter\isAppendingNewlines().
|
protected |
Definition at line 28 of file JsonFormatter.php.
Referenced by Monolog\Formatter\LogglyFormatter\__construct(), Monolog\Formatter\JsonFormatter\__construct(), and Monolog\Formatter\JsonFormatter\getBatchMode().
|
protected |
Definition at line 33 of file JsonFormatter.php.
const Monolog\Formatter\JsonFormatter::BATCH_MODE_JSON = 1 |
Definition at line 25 of file JsonFormatter.php.
Referenced by Monolog\Handler\CouchDBHandler\getDefaultFormatter(), Monolog\Handler\AmqpHandler\getDefaultFormatter(), Monolog\Formatter\LogglyFormatterTest\testConstruct(), Monolog\Formatter\JsonFormatterTest\testConstruct(), and Monolog\Formatter\JsonFormatterTest\testFormat().
const Monolog\Formatter\JsonFormatter::BATCH_MODE_NEWLINES = 2 |
Definition at line 26 of file JsonFormatter.php.
Referenced by Monolog\Formatter\LogglyFormatterTest\testConstruct(), Monolog\Formatter\JsonFormatterTest\testConstruct(), and Monolog\Formatter\JsonFormatterTest\testFormatBatchNewlines().