mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-21 12:22:21 +02:00
Update readme, fix cs
This commit is contained in:
@@ -196,6 +196,7 @@ Processors
|
|||||||
- _MemoryPeakUsageProcessor_: Adds the peak memory usage to a log record.
|
- _MemoryPeakUsageProcessor_: Adds the peak memory usage to a log record.
|
||||||
- _ProcessIdProcessor_: Adds the process id to a log record.
|
- _ProcessIdProcessor_: Adds the process id to a log record.
|
||||||
- _UidProcessor_: Adds a unique identifier to a log record.
|
- _UidProcessor_: Adds a unique identifier to a log record.
|
||||||
|
- _GitProcessor_: Adds the current git branch and commit to a log record.
|
||||||
|
|
||||||
Utilities
|
Utilities
|
||||||
---------
|
---------
|
||||||
|
@@ -47,6 +47,7 @@ class ElasticaFormatter extends NormalizerFormatter
|
|||||||
public function format(array $record)
|
public function format(array $record)
|
||||||
{
|
{
|
||||||
$record = parent::format($record);
|
$record = parent::format($record);
|
||||||
|
|
||||||
return $this->getDocument($record);
|
return $this->getDocument($record);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +72,7 @@ class ElasticaFormatter extends NormalizerFormatter
|
|||||||
/**
|
/**
|
||||||
* Convert a log message into an Elastica Document
|
* Convert a log message into an Elastica Document
|
||||||
*
|
*
|
||||||
* @param array $record Log message
|
* @param array $record Log message
|
||||||
* @return Document
|
* @return Document
|
||||||
*/
|
*/
|
||||||
protected function getDocument($record)
|
protected function getDocument($record)
|
||||||
@@ -80,6 +81,7 @@ class ElasticaFormatter extends NormalizerFormatter
|
|||||||
$document->setData($record);
|
$document->setData($record);
|
||||||
$document->setType($this->type);
|
$document->setType($this->type);
|
||||||
$document->setIndex($this->index);
|
$document->setIndex($this->index);
|
||||||
|
|
||||||
return $document;
|
return $document;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -34,7 +34,7 @@ class ScalarFormatter extends NormalizerFormatter
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $value
|
* @param mixed $value
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
protected function normalizeValue($value)
|
protected function normalizeValue($value)
|
||||||
|
@@ -39,9 +39,9 @@ class DynamoDbHandler extends AbstractProcessingHandler
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param DynamoDbClient $client
|
* @param DynamoDbClient $client
|
||||||
* @param string $table
|
* @param string $table
|
||||||
* @param integer $level
|
* @param integer $level
|
||||||
* @param boolean $bubble
|
* @param boolean $bubble
|
||||||
*/
|
*/
|
||||||
public function __construct(DynamoDbClient $client, $table, $level = Logger::DEBUG, $bubble = true)
|
public function __construct(DynamoDbClient $client, $table, $level = Logger::DEBUG, $bubble = true)
|
||||||
{
|
{
|
||||||
@@ -70,7 +70,7 @@ class DynamoDbHandler extends AbstractProcessingHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $record
|
* @param array $record
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
protected function filterEmptyFields(array $record)
|
protected function filterEmptyFields(array $record)
|
||||||
|
@@ -46,10 +46,10 @@ class ElasticSearchHandler extends AbstractProcessingHandler
|
|||||||
protected $options = array();
|
protected $options = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Client $client Elastica Client object
|
* @param Client $client Elastica Client object
|
||||||
* @param array $options Handler configuration
|
* @param array $options Handler configuration
|
||||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||||
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
|
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
|
||||||
*/
|
*/
|
||||||
public function __construct(Client $client, array $options = array(), $level = Logger::DEBUG, $bubble = true)
|
public function __construct(Client $client, array $options = array(), $level = Logger::DEBUG, $bubble = true)
|
||||||
{
|
{
|
||||||
@@ -112,7 +112,7 @@ class ElasticSearchHandler extends AbstractProcessingHandler
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Use Elasticsearch bulk API to send list of documents
|
* Use Elasticsearch bulk API to send list of documents
|
||||||
* @param array $documents
|
* @param array $documents
|
||||||
* @throws \RuntimeException
|
* @throws \RuntimeException
|
||||||
*/
|
*/
|
||||||
protected function bulkSend(array $documents)
|
protected function bulkSend(array $documents)
|
||||||
|
@@ -73,7 +73,8 @@ class StreamHandler extends AbstractProcessingHandler
|
|||||||
fwrite($this->stream, (string) $record['formatted']);
|
fwrite($this->stream, (string) $record['formatted']);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function customErrorHandler($code, $msg) {
|
private function customErrorHandler($code, $msg)
|
||||||
|
{
|
||||||
$this->errorMessage = preg_replace('{^fopen\(.*?\): }', '', $msg);
|
$this->errorMessage = preg_replace('{^fopen\(.*?\): }', '', $msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user