ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Monolog\Formatter\ElasticaFormatter Class Reference

Format a log message into an Elastica Document. More...

+ Inheritance diagram for Monolog\Formatter\ElasticaFormatter:
+ Collaboration diagram for Monolog\Formatter\ElasticaFormatter:

Public Member Functions

 __construct ($index, $type)
 
 format (array $record)
 {Formats a log record.
Parameters
array$recordA record to format
Returns
mixed The formatted record
} More...
 
 getIndex ()
 Getter index. More...
 
 getType ()
 Getter type. More...
 
- Public Member Functions inherited from Monolog\Formatter\NormalizerFormatter
 __construct ($dateFormat=null)
 
 format (array $record)
 {Formats a log record.
Parameters
array$recordA record to format
Returns
mixed The formatted record
} More...
 
 formatBatch (array $records)
 {Formats a set of log records.
Parameters
array$recordsA set of records to format
Returns
mixed The formatted set of records
} More...
 
 detectAndCleanUtf8 (&$data)
 Detect invalid UTF-8 string characters and convert to valid UTF-8. More...
 

Protected Member Functions

 getDocument ($record)
 Convert a log message into an Elastica Document. 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

 $index
 
 $type
 
- Protected Attributes inherited from Monolog\Formatter\NormalizerFormatter
 $dateFormat
 

Additional Inherited Members

- Data Fields inherited from Monolog\Formatter\NormalizerFormatter
const SIMPLE_DATE = "Y-m-d H:i:s"
 

Detailed Description

Format a log message into an Elastica Document.

Author
Jelle Vink jelle.nosp@m..vin.nosp@m.k@gma.nosp@m.il.c.nosp@m.om

Definition at line 21 of file ElasticaFormatter.php.

Constructor & Destructor Documentation

◆ __construct()

Monolog\Formatter\ElasticaFormatter::__construct (   $index,
  $type 
)
Parameters
string$indexElastic Search index name
string$typeElastic Search document type

Definition at line 37 of file ElasticaFormatter.php.

References Monolog\Formatter\ElasticaFormatter\$index, and Monolog\Formatter\ElasticaFormatter\$type.

38  {
39  // elasticsearch requires a ISO 8601 format date with optional millisecond precision.
40  parent::__construct('Y-m-d\TH:i:s.uP');
41 
42  $this->index = $index;
43  $this->type = $type;
44  }

Member Function Documentation

◆ format()

Monolog\Formatter\ElasticaFormatter::format ( array  $record)

{Formats a log record.

Parameters
array$recordA record to format
Returns
mixed The formatted record
}

Implements Monolog\Formatter\FormatterInterface.

Definition at line 49 of file ElasticaFormatter.php.

References format, and Monolog\Formatter\ElasticaFormatter\getDocument().

50  {
51  $record = parent::format($record);
52 
53  return $this->getDocument($record);
54  }
Write to Excel2007 format
getDocument($record)
Convert a log message into an Elastica Document.
+ Here is the call graph for this function:

◆ getDocument()

Monolog\Formatter\ElasticaFormatter::getDocument (   $record)
protected

Convert a log message into an Elastica Document.

Parameters
array$recordLog message
Returns
Document

Definition at line 80 of file ElasticaFormatter.php.

Referenced by Monolog\Formatter\ElasticaFormatter\format().

81  {
82  $document = new Document();
83  $document->setData($record);
84  $document->setType($this->type);
85  $document->setIndex($this->index);
86 
87  return $document;
88  }
+ Here is the caller graph for this function:

◆ getIndex()

Monolog\Formatter\ElasticaFormatter::getIndex ( )

Getter index.

Returns
string

Definition at line 60 of file ElasticaFormatter.php.

References Monolog\Formatter\ElasticaFormatter\$index.

◆ getType()

Monolog\Formatter\ElasticaFormatter::getType ( )

Getter type.

Returns
string

Definition at line 69 of file ElasticaFormatter.php.

References Monolog\Formatter\ElasticaFormatter\$type.

Field Documentation

◆ $index

Monolog\Formatter\ElasticaFormatter::$index
protected

◆ $type

Monolog\Formatter\ElasticaFormatter::$type
protected

The documentation for this class was generated from the following file: