Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/worker/src/Monolog/Handler
File: LegacyGelfHandler.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/*
[2] Fix | Delete
* This file is part of the Monolog package.
[3] Fix | Delete
*
[4] Fix | Delete
* (c) Jordi Boggiano <j.boggiano@seld.be>
[5] Fix | Delete
*
[6] Fix | Delete
* For the full copyright and license information, please view the LICENSE
[7] Fix | Delete
* file that was distributed with this source code.
[8] Fix | Delete
*/
[9] Fix | Delete
[10] Fix | Delete
/**
[11] Fix | Delete
* Handler to send messages to a Graylog2 (http://www.graylog2.org) server
[12] Fix | Delete
*
[13] Fix | Delete
* @author Matt Lehner <mlehner@gmail.com>
[14] Fix | Delete
*/
[15] Fix | Delete
class Monolog_Handler_LegacyGelfHandler extends Monolog_Handler_AbstractProcessingHandler
[16] Fix | Delete
{
[17] Fix | Delete
/**
[18] Fix | Delete
* @var Gelf_Publisher the publisher object that sends the message to the server
[19] Fix | Delete
*/
[20] Fix | Delete
protected $publisher;
[21] Fix | Delete
[22] Fix | Delete
/**
[23] Fix | Delete
* @param Gelf_Publisher $publisher a publisher object
[24] Fix | Delete
* @param integer $level The minimum logging level at which this handler will be triggered
[25] Fix | Delete
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
[26] Fix | Delete
*/
[27] Fix | Delete
public function __construct(Gelf_Publisher $publisher, $level = Monolog_Logger::DEBUG, $bubble = true)
[28] Fix | Delete
{
[29] Fix | Delete
parent::__construct($level, $bubble);
[30] Fix | Delete
[31] Fix | Delete
$this->publisher = $publisher;
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
/**
[35] Fix | Delete
* {@inheritdoc}
[36] Fix | Delete
*/
[37] Fix | Delete
public function close()
[38] Fix | Delete
{
[39] Fix | Delete
$this->publisher = null;
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
/**
[43] Fix | Delete
* {@inheritdoc}
[44] Fix | Delete
*/
[45] Fix | Delete
protected function write(array $record)
[46] Fix | Delete
{
[47] Fix | Delete
$this->publisher->publish($record['formatted']);
[48] Fix | Delete
}
[49] Fix | Delete
[50] Fix | Delete
/**
[51] Fix | Delete
* {@inheritDoc}
[52] Fix | Delete
*/
[53] Fix | Delete
protected function getDefaultFormatter()
[54] Fix | Delete
{
[55] Fix | Delete
return new Monolog_Formatter_LegacyGelfMessageFormatter();
[56] Fix | Delete
}
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function