Log message formatter that uses the apache Avro format.
More...
|
| __construct (array $schemas) |
|
| format (array $record) |
| Formats the record context into a binary string per the schema configured for the records channel.
|
|
| formatBatch (array $records) |
| Format a set of records into a list of binary strings conforming to the configured schema.
|
|
| getSchemaRevisionId ( $channel) |
| Get the writer for the named channel.
|
|
|
| getSchema ( $channel) |
| Get the writer for the named channel.
|
|
|
| encodeLong ( $id) |
| convert an integer to a 64bits big endian long (Java compatible) NOTE: certainly only compatible with PHP 64bits
|
|
|
const | MAGIC = 0x0 |
| Magic byte to encode schema revision id.
|
|
Log message formatter that uses the apache Avro format.
- Since
- 1.26
- Author
- Erik Bernhardson ebern.nosp@m.hard.nosp@m.son@w.nosp@m.ikim.nosp@m.edia..nosp@m.org
- Note
- © 2015 Erik Bernhardson and Wikimedia Foundation.
Definition at line 38 of file AvroFormatter.php.
◆ __construct()
MediaWiki\Logger\Monolog\AvroFormatter::__construct |
( |
array |
$schemas | ) |
|
◆ encodeLong()
MediaWiki\Logger\Monolog\AvroFormatter::encodeLong |
( |
|
$id | ) |
|
|
private |
convert an integer to a 64bits big endian long (Java compatible) NOTE: certainly only compatible with PHP 64bits
- Parameters
-
- Returns
- string the binary representation of $id
Definition at line 169 of file AvroFormatter.php.
◆ format()
MediaWiki\Logger\Monolog\AvroFormatter::format |
( |
array |
$record | ) |
|
Formats the record context into a binary string per the schema configured for the records channel.
- Parameters
-
- Returns
- string The serialized record, or an empty string if the record is not valid for the selected schema.
Definition at line 83 of file AvroFormatter.php.
◆ formatBatch()
MediaWiki\Logger\Monolog\AvroFormatter::formatBatch |
( |
array |
$records | ) |
|
Format a set of records into a list of binary strings conforming to the configured schema.
- Parameters
-
- Returns
- string[]
Definition at line 109 of file AvroFormatter.php.
◆ getSchema()
MediaWiki\Logger\Monolog\AvroFormatter::getSchema |
( |
|
$channel | ) |
|
|
protected |
Get the writer for the named channel.
- Parameters
-
string | $channel | Name of the schema to fetch |
- Returns
- \AvroSchema|null
Definition at line 126 of file AvroFormatter.php.
◆ getSchemaRevisionId()
MediaWiki\Logger\Monolog\AvroFormatter::getSchemaRevisionId |
( |
|
$channel | ) |
|
Get the writer for the named channel.
- Parameters
-
string | $channel | Name of the schema |
- Returns
- int|null
Definition at line 156 of file AvroFormatter.php.
◆ $encoder
AvroIOBinaryEncoder MediaWiki\Logger\Monolog\AvroFormatter::$encoder |
|
protected |
◆ $io
AvroStringIO MediaWiki\Logger\Monolog\AvroFormatter::$io |
|
protected |
◆ $schemas
array MediaWiki\Logger\Monolog\AvroFormatter::$schemas |
|
protected |
◆ $writer
AvroIODatumWriter MediaWiki\Logger\Monolog\AvroFormatter::$writer |
|
protected |
◆ MAGIC
const MediaWiki\Logger\Monolog\AvroFormatter::MAGIC = 0x0 |
|
private |
The documentation for this class was generated from the following file: