ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Normalizes incoming records to remove objects/resources so it's easier to dump to various targets. More...
Public Member Functions | ||||
__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 | SIMPLE_DATE = "Y-m-d H:i:s" |
Protected Member Functions | |
normalize ($data) | |
normalizeException ($e) | |
toJson ($data, $ignoreErrors=false) | |
Return the JSON representation of a value. More... | |
Protected Attributes | |
$dateFormat | |
Private Member Functions | |
jsonEncode ($data) | |
handleJsonError ($code, $data) | |
Handle a json_encode failure. More... | |
throwEncodeError ($code, $data) | |
Throws an exception according to a given code with a customized message. More... | |
Normalizes incoming records to remove objects/resources so it's easier to dump to various targets.
Definition at line 21 of file NormalizerFormatter.php.
Monolog\Formatter\NormalizerFormatter::__construct | ( | $dateFormat = null | ) |
string | $dateFormat | The format of the timestamp: one supported by DateTime::format |
Definition at line 30 of file NormalizerFormatter.php.
References Monolog\Formatter\NormalizerFormatter\$dateFormat.
Monolog\Formatter\NormalizerFormatter::detectAndCleanUtf8 | ( | & | $data | ) |
Detect invalid UTF-8 string characters and convert to valid UTF-8.
Valid UTF-8 input will be left unmodified, but strings containing invalid UTF-8 codepoints will be reencoded as UTF-8 with an assumed original encoding of ISO-8859-15. This conversion may result in incorrect output if the actual encoding was not ISO-8859-15, but it will be clean UTF-8 output and will not rely on expensive and fragile detection algorithms.
Function converts the input in place in the passed variable so that it can be used as a callback for array_walk_recursive.
mixed | &$data | Input to check and convert if needed |
Definition at line 282 of file NormalizerFormatter.php.
References $data, $m, and array.
Referenced by Monolog\Formatter\NormalizerFormatter\handleJsonError().
Monolog\Formatter\NormalizerFormatter::format | ( | array | $record | ) |
{Formats a log record.
array | $record | A record to format |
Implements Monolog\Formatter\FormatterInterface.
Definition at line 41 of file NormalizerFormatter.php.
References Monolog\Formatter\NormalizerFormatter\normalize().
Referenced by Monolog\Formatter\NormalizerFormatter\formatBatch().
Monolog\Formatter\NormalizerFormatter::formatBatch | ( | array | $records | ) |
{Formats a set of log records.
array | $records | A set of records to format |
Implements Monolog\Formatter\FormatterInterface.
Definition at line 49 of file NormalizerFormatter.php.
References $key, $records, and Monolog\Formatter\NormalizerFormatter\format().
|
private |
Handle a json_encode failure.
If the failure is due to invalid string encoding, try to clean the input and encode again. If the second encoding attempt fails, the inital error is not encoding related or the input can't be cleaned then raise a descriptive exception.
int | $code | return code of json_last_error function |
mixed | $data | data that was meant to be encoded |
Definition at line 214 of file NormalizerFormatter.php.
References $code, $data, array, Monolog\Formatter\NormalizerFormatter\detectAndCleanUtf8(), Monolog\Formatter\NormalizerFormatter\jsonEncode(), and Monolog\Formatter\NormalizerFormatter\throwEncodeError().
Referenced by Monolog\Formatter\NormalizerFormatter\toJson().
|
private |
mixed | $data |
Definition at line 192 of file NormalizerFormatter.php.
References $data.
Referenced by Monolog\Formatter\NormalizerFormatter\handleJsonError(), and Monolog\Formatter\NormalizerFormatter\toJson().
|
protected |
Definition at line 58 of file NormalizerFormatter.php.
References $data, $key, array, Monolog\Formatter\NormalizerFormatter\normalizeException(), and Monolog\Formatter\NormalizerFormatter\toJson().
Referenced by Monolog\Formatter\HtmlFormatter\convertToString(), Monolog\Formatter\NormalizerFormatter\format(), Monolog\Formatter\NormalizerFormatter\normalizeException(), and Monolog\Formatter\ScalarFormatter\normalizeValue().
|
protected |
Definition at line 116 of file NormalizerFormatter.php.
References $data, array, Monolog\Formatter\NormalizerFormatter\normalize(), and Monolog\Formatter\NormalizerFormatter\toJson().
Referenced by Monolog\Formatter\NormalizerFormatter\normalize().
|
private |
Throws an exception according to a given code with a customized message.
int | $code | return code of json_last_error function |
mixed | $data | data that was meant to be encoded |
Definition at line 244 of file NormalizerFormatter.php.
Referenced by Monolog\Formatter\NormalizerFormatter\handleJsonError().
|
protected |
Return the JSON representation of a value.
mixed | $data | |
bool | $ignoreErrors |
Definition at line 172 of file NormalizerFormatter.php.
References $data, Monolog\Formatter\NormalizerFormatter\handleJsonError(), and Monolog\Formatter\NormalizerFormatter\jsonEncode().
Referenced by Monolog\Formatter\LineFormatter\convertToString(), Monolog\Formatter\WildfireFormatter\format(), Monolog\Formatter\GelfMessageFormatter\format(), Monolog\Formatter\JsonFormatter\format(), Monolog\Formatter\LogstashFormatter\format(), Monolog\Formatter\JsonFormatter\formatBatchJson(), Monolog\Formatter\NormalizerFormatter\normalize(), Monolog\Formatter\NormalizerFormatter\normalizeException(), and Monolog\Formatter\ScalarFormatter\normalizeValue().
|
protected |
Definition at line 25 of file NormalizerFormatter.php.
Referenced by Monolog\Formatter\NormalizerFormatter\__construct(), Monolog\Formatter\LineFormatter\__construct(), and Monolog\Formatter\HtmlFormatter\__construct().
const Monolog\Formatter\NormalizerFormatter::SIMPLE_DATE = "Y-m-d H:i:s" |
Definition at line 23 of file NormalizerFormatter.php.