mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-21 08:36:33 +02:00
CS fixes & upgrading cs fixer config
This commit is contained in:
@@ -32,7 +32,7 @@ abstract class AbstractHandler implements HandlerInterface
|
||||
protected $processors = array();
|
||||
|
||||
/**
|
||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||
* @param int $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
|
||||
*/
|
||||
public function __construct($level = Logger::DEBUG, $bubble = true)
|
||||
@@ -118,7 +118,7 @@ abstract class AbstractHandler implements HandlerInterface
|
||||
/**
|
||||
* Sets minimum logging level at which this handler will be triggered.
|
||||
*
|
||||
* @param integer $level
|
||||
* @param int $level
|
||||
* @return self
|
||||
*/
|
||||
public function setLevel($level)
|
||||
@@ -131,7 +131,7 @@ abstract class AbstractHandler implements HandlerInterface
|
||||
/**
|
||||
* Gets minimum logging level at which this handler will be triggered.
|
||||
*
|
||||
* @return integer
|
||||
* @return int
|
||||
*/
|
||||
public function getLevel()
|
||||
{
|
||||
|
@@ -54,7 +54,7 @@ abstract class AbstractSyslogHandler extends AbstractProcessingHandler
|
||||
|
||||
/**
|
||||
* @param mixed $facility
|
||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||
* @param int $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
|
||||
*/
|
||||
public function __construct($facility = LOG_USER, $level = Logger::DEBUG, $bubble = true)
|
||||
|
@@ -70,7 +70,7 @@ class AmqpHandler extends AbstractProcessingHandler
|
||||
0,
|
||||
array(
|
||||
'delivery_mode' => 2,
|
||||
'Content-type' => 'application/json'
|
||||
'Content-type' => 'application/json',
|
||||
)
|
||||
);
|
||||
} else {
|
||||
@@ -79,7 +79,7 @@ class AmqpHandler extends AbstractProcessingHandler
|
||||
(string) $data,
|
||||
array(
|
||||
'delivery_mode' => 2,
|
||||
'content_type' => 'application/json'
|
||||
'content_type' => 'application/json',
|
||||
)
|
||||
),
|
||||
$this->exchangeName,
|
||||
|
@@ -31,7 +31,6 @@ class BrowserConsoleHandler extends AbstractProcessingHandler
|
||||
* Example of formatted string:
|
||||
*
|
||||
* You can do [[blue text]]{color: blue} or [[green background]]{background-color: green; color: white}
|
||||
*
|
||||
*/
|
||||
protected function getDefaultFormatter()
|
||||
{
|
||||
|
@@ -32,8 +32,8 @@ class BufferHandler extends AbstractHandler
|
||||
|
||||
/**
|
||||
* @param HandlerInterface $handler Handler.
|
||||
* @param integer $bufferLimit How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
|
||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||
* @param int $bufferLimit How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
|
||||
* @param int $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 $flushOnOverflow If true, the buffer is flushed when the max size has been reached, by default oldest entries are discarded
|
||||
*/
|
||||
|
@@ -51,7 +51,7 @@ class ChromePHPHandler extends AbstractProcessingHandler
|
||||
protected static $sendHeaders = true;
|
||||
|
||||
/**
|
||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||
* @param int $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
|
||||
*/
|
||||
public function __construct($level = Logger::DEBUG, $bubble = true)
|
||||
|
@@ -54,7 +54,7 @@ class CouchDBHandler extends AbstractProcessingHandler
|
||||
'ignore_errors' => true,
|
||||
'max_redirects' => 0,
|
||||
'header' => 'Content-type: application/json',
|
||||
)
|
||||
),
|
||||
));
|
||||
|
||||
if (false === @file_get_contents($url, null, $context)) {
|
||||
|
@@ -32,8 +32,8 @@ class CubeHandler extends AbstractProcessingHandler
|
||||
* Create a Cube handler
|
||||
*
|
||||
* @throws \UnexpectedValueException when given url is not a valid url.
|
||||
* A valid url must consist of three parts : protocol://host:port
|
||||
* Only valid protocols used by Cube are http and udp
|
||||
* A valid url must consist of three parts : protocol://host:port
|
||||
* Only valid protocols used by Cube are http and udp
|
||||
*/
|
||||
public function __construct($url, $level = Logger::DEBUG, $bubble = true)
|
||||
{
|
||||
@@ -59,7 +59,7 @@ class CubeHandler extends AbstractProcessingHandler
|
||||
/**
|
||||
* Establish a connection to an UDP socket
|
||||
*
|
||||
* @throws \LogicException when unable to connect to the socket
|
||||
* @throws \LogicException when unable to connect to the socket
|
||||
* @throws MissingExtensionException when there is no socket extension
|
||||
*/
|
||||
protected function connectUdp()
|
||||
@@ -142,9 +142,9 @@ class CubeHandler extends AbstractProcessingHandler
|
||||
|
||||
curl_setopt($this->httpConnection, CURLOPT_POSTFIELDS, '['.$data.']');
|
||||
curl_setopt($this->httpConnection, CURLOPT_HTTPHEADER, array(
|
||||
'Content-Type: application/json',
|
||||
'Content-Length: ' . strlen('['.$data.']'))
|
||||
);
|
||||
'Content-Type: application/json',
|
||||
'Content-Length: ' . strlen('['.$data.']'),
|
||||
));
|
||||
|
||||
Curl\Util::execute($this->httpConnection, 5, false);
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ class Util
|
||||
/**
|
||||
* Executes a CURL request with optional retries and exception on failure
|
||||
*
|
||||
* @param resource $ch curl handler
|
||||
* @param resource $ch curl handler
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
public static function execute($ch, $retries = 5, $closeAfterDone = true)
|
||||
|
@@ -39,8 +39,8 @@ class DynamoDbHandler extends AbstractProcessingHandler
|
||||
/**
|
||||
* @param DynamoDbClient $client
|
||||
* @param string $table
|
||||
* @param integer $level
|
||||
* @param boolean $bubble
|
||||
* @param int $level
|
||||
* @param bool $bubble
|
||||
*/
|
||||
public function __construct(DynamoDbClient $client, $table, $level = Logger::DEBUG, $bubble = true)
|
||||
{
|
||||
@@ -64,7 +64,7 @@ class DynamoDbHandler extends AbstractProcessingHandler
|
||||
|
||||
$this->client->putItem(array(
|
||||
'TableName' => $this->table,
|
||||
'Item' => $formatted
|
||||
'Item' => $formatted,
|
||||
));
|
||||
}
|
||||
|
||||
|
@@ -48,7 +48,7 @@ class ElasticSearchHandler extends AbstractProcessingHandler
|
||||
/**
|
||||
* @param Client $client Elastica Client object
|
||||
* @param array $options Handler configuration
|
||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||
* @param int $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
|
||||
*/
|
||||
public function __construct(Client $client, array $options = array(), $level = Logger::DEBUG, $bubble = true)
|
||||
|
@@ -28,8 +28,8 @@ class ErrorLogHandler extends AbstractProcessingHandler
|
||||
protected $expandNewlines;
|
||||
|
||||
/**
|
||||
* @param integer $messageType Says where the error should go.
|
||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||
* @param int $messageType Says where the error should go.
|
||||
* @param int $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 $expandNewlines If set to true, newlines in the message will be expanded to be take multiple log entries
|
||||
*/
|
||||
|
@@ -2,12 +2,12 @@
|
||||
|
||||
/*
|
||||
* This file is part of the Monolog package.
|
||||
*
|
||||
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
*
|
||||
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Monolog\Handler\FingersCrossed;
|
||||
|
||||
|
@@ -118,7 +118,7 @@ class FleepHookHandler extends SocketHandler
|
||||
private function buildContent($record)
|
||||
{
|
||||
$dataArray = array(
|
||||
'message' => $record['formatted']
|
||||
'message' => $record['formatted'],
|
||||
);
|
||||
|
||||
return http_build_query($dataArray);
|
||||
|
@@ -33,8 +33,8 @@ class GelfHandler extends AbstractProcessingHandler
|
||||
|
||||
/**
|
||||
* @param PublisherInterface|IMessagePublisher|Publisher $publisher a publisher object
|
||||
* @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 int $level The minimum logging level at which this handler will be triggered
|
||||
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
||||
*/
|
||||
public function __construct($publisher, $level = Logger::DEBUG, $bubble = true)
|
||||
{
|
||||
|
@@ -84,16 +84,16 @@ class HipChatHandler extends SocketHandler
|
||||
private $version;
|
||||
|
||||
/**
|
||||
* @param string $token HipChat API Token
|
||||
* @param string $room The room that should be alerted of the message (Id or Name)
|
||||
* @param string $name Name used in the "from" field. Not used for v2
|
||||
* @param bool $notify Trigger a notification in clients or not
|
||||
* @param int $level The minimum logging level at which this handler will be triggered
|
||||
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
||||
* @param bool $useSSL Whether to connect via SSL.
|
||||
* @param string $format The format of the messages (default to text, can be set to html if you have html in the messages)
|
||||
* @param string $host The HipChat server hostname.
|
||||
* @param string $version The HipChat API version (default HipChatHandler::API_V1)
|
||||
* @param string $token HipChat API Token
|
||||
* @param string $room The room that should be alerted of the message (Id or Name)
|
||||
* @param string $name Name used in the "from" field. Not used for v2
|
||||
* @param bool $notify Trigger a notification in clients or not
|
||||
* @param int $level The minimum logging level at which this handler will be triggered
|
||||
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
||||
* @param bool $useSSL Whether to connect via SSL.
|
||||
* @param string $format The format of the messages (default to text, can be set to html if you have html in the messages)
|
||||
* @param string $host The HipChat server hostname.
|
||||
* @param string $version The HipChat API version (default HipChatHandler::API_V1)
|
||||
*/
|
||||
public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text', $host = 'api.hipchat.com', $version = self::API_V1)
|
||||
{
|
||||
@@ -179,7 +179,7 @@ class HipChatHandler extends SocketHandler
|
||||
/**
|
||||
* Assigns a color to each level of log records.
|
||||
*
|
||||
* @param integer $level
|
||||
* @param int $level
|
||||
* @return string
|
||||
*/
|
||||
protected function getAlertColor($level)
|
||||
@@ -303,7 +303,7 @@ class HipChatHandler extends SocketHandler
|
||||
array(
|
||||
'level' => $level,
|
||||
'level_name' => $levelName,
|
||||
'datetime' => $datetime
|
||||
'datetime' => $datetime,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@@ -30,10 +30,10 @@ class IFTTTHandler extends AbstractProcessingHandler
|
||||
private $secretKey;
|
||||
|
||||
/**
|
||||
* @param string $eventName The name of the IFTTT Maker event that should be triggered
|
||||
* @param string $secretKey A valid IFTTT secret key
|
||||
* @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 string $eventName The name of the IFTTT Maker event that should be triggered
|
||||
* @param string $secretKey A valid IFTTT secret key
|
||||
* @param int $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
|
||||
*/
|
||||
public function __construct($eventName, $secretKey, $level = Logger::ERROR, $bubble = true)
|
||||
{
|
||||
@@ -51,7 +51,7 @@ class IFTTTHandler extends AbstractProcessingHandler
|
||||
$postData = array(
|
||||
"value1" => $record["channel"],
|
||||
"value2" => $record["level_name"],
|
||||
"value3" => $record["message"]
|
||||
"value3" => $record["message"],
|
||||
);
|
||||
$postString = json_encode($postData);
|
||||
|
||||
@@ -61,7 +61,7 @@ class IFTTTHandler extends AbstractProcessingHandler
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
||||
"Content-Type: application/json"
|
||||
"Content-Type: application/json",
|
||||
));
|
||||
|
||||
Curl\Util::execute($ch);
|
||||
|
@@ -24,10 +24,10 @@ class LogEntriesHandler extends SocketHandler
|
||||
protected $logToken;
|
||||
|
||||
/**
|
||||
* @param string $token Log token supplied by LogEntries
|
||||
* @param boolean $useSSL Whether or not SSL encryption should be used.
|
||||
* @param int $level The minimum logging level to trigger this handler
|
||||
* @param boolean $bubble Whether or not messages that are handled should bubble up the stack.
|
||||
* @param string $token Log token supplied by LogEntries
|
||||
* @param bool $useSSL Whether or not SSL encryption should be used.
|
||||
* @param int $level The minimum logging level to trigger this handler
|
||||
* @param bool $bubble Whether or not messages that are handled should bubble up the stack.
|
||||
*
|
||||
* @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing
|
||||
*/
|
||||
|
@@ -26,7 +26,7 @@ class MandrillHandler extends MailHandler
|
||||
/**
|
||||
* @param string $apiKey A valid Mandrill API key
|
||||
* @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced
|
||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||
* @param int $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
|
||||
*/
|
||||
public function __construct($apiKey, $message, $level = Logger::ERROR, $bubble = true)
|
||||
|
@@ -47,7 +47,7 @@ class NativeMailerHandler extends MailHandler
|
||||
|
||||
/**
|
||||
* The wordwrap length for the message
|
||||
* @var integer
|
||||
* @var int
|
||||
*/
|
||||
protected $maxColumnWidth;
|
||||
|
||||
@@ -67,8 +67,8 @@ class NativeMailerHandler extends MailHandler
|
||||
* @param string|array $to The receiver of the mail
|
||||
* @param string $subject The subject of the mail
|
||||
* @param string $from The sender of the mail
|
||||
* @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 int $level The minimum logging level at which this handler will be triggered
|
||||
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
||||
* @param int $maxColumnWidth The maximum column width that the message lines will have
|
||||
*/
|
||||
public function __construct($to, $subject, $from, $level = Logger::ERROR, $bubble = true, $maxColumnWidth = 70)
|
||||
@@ -101,7 +101,7 @@ class NativeMailerHandler extends MailHandler
|
||||
/**
|
||||
* Add parameters to the message
|
||||
*
|
||||
* @param string|array $parameters Custom added parameters
|
||||
* @param string|array $parameters Custom added parameters
|
||||
* @return self
|
||||
*/
|
||||
public function addParameter($parameters)
|
||||
|
@@ -41,16 +41,16 @@ class NewRelicHandler extends AbstractProcessingHandler
|
||||
* Some context and extra data is passed into the handler as arrays of values. Do we send them as is
|
||||
* (useful if we are using the API), or explode them for display on the NewRelic RPM website?
|
||||
*
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
protected $explodeArrays;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @param string $appName
|
||||
* @param boolean $explodeArrays
|
||||
* @param string $transactionName
|
||||
* @param string $appName
|
||||
* @param bool $explodeArrays
|
||||
* @param string $transactionName
|
||||
*/
|
||||
public function __construct(
|
||||
$level = Logger::ERROR,
|
||||
|
@@ -24,7 +24,7 @@ use Monolog\Logger;
|
||||
class NullHandler extends AbstractHandler
|
||||
{
|
||||
/**
|
||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||
* @param int $level The minimum logging level at which this handler will be triggered
|
||||
*/
|
||||
public function __construct($level = Logger::DEBUG)
|
||||
{
|
||||
|
@@ -66,10 +66,10 @@ class PHPConsoleHandler extends AbstractProcessingHandler
|
||||
private $connector;
|
||||
|
||||
/**
|
||||
* @param array $options See \Monolog\Handler\PHPConsoleHandler::$options for more details
|
||||
* @param Connector|null $connector Instance of \PhpConsole\Connector class (optional)
|
||||
* @param int $level
|
||||
* @param bool $bubble
|
||||
* @param array $options See \Monolog\Handler\PHPConsoleHandler::$options for more details
|
||||
* @param Connector|null $connector Instance of \PhpConsole\Connector class (optional)
|
||||
* @param int $level
|
||||
* @param bool $bubble
|
||||
* @throws Exception
|
||||
*/
|
||||
public function __construct(array $options = array(), Connector $connector = null, $level = Logger::DEBUG, $bubble = true)
|
||||
|
@@ -68,16 +68,16 @@ class PushoverHandler extends SocketHandler
|
||||
* @param string $token Pushover api token
|
||||
* @param string|array $users Pushover user id or array of ids the message will be sent to
|
||||
* @param string $title Title sent to the Pushover API
|
||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||
* @param int $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 $useSSL Whether to connect via SSL. Required when pushing messages to users that are not
|
||||
* the pushover.net app owner. OpenSSL is required for this option.
|
||||
* @param integer $highPriorityLevel The minimum logging level at which this handler will start
|
||||
* @param int $highPriorityLevel The minimum logging level at which this handler will start
|
||||
* sending "high priority" requests to the Pushover API
|
||||
* @param integer $emergencyLevel The minimum logging level at which this handler will start
|
||||
* @param int $emergencyLevel The minimum logging level at which this handler will start
|
||||
* sending "emergency" requests to the Pushover API
|
||||
* @param integer $retry The retry parameter specifies how often (in seconds) the Pushover servers will send the same notification to the user.
|
||||
* @param integer $expire The expire parameter specifies how many seconds your notification will continue to be retried for (every retry seconds).
|
||||
* @param int $retry The retry parameter specifies how often (in seconds) the Pushover servers will send the same notification to the user.
|
||||
* @param int $expire The expire parameter specifies how many seconds your notification will continue to be retried for (every retry seconds).
|
||||
*/
|
||||
public function __construct($token, $users, $title = null, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $highPriorityLevel = Logger::CRITICAL, $emergencyLevel = Logger::EMERGENCY, $retry = 30, $expire = 25200)
|
||||
{
|
||||
@@ -115,7 +115,7 @@ class PushoverHandler extends SocketHandler
|
||||
'user' => $this->user,
|
||||
'message' => $message,
|
||||
'title' => $this->title,
|
||||
'timestamp' => $timestamp
|
||||
'timestamp' => $timestamp,
|
||||
);
|
||||
|
||||
if (isset($record['level']) && $record['level'] >= $this->emergencyLevel) {
|
||||
@@ -176,7 +176,7 @@ class PushoverHandler extends SocketHandler
|
||||
|
||||
/**
|
||||
* Use the formatted message?
|
||||
* @param boolean $value
|
||||
* @param bool $value
|
||||
*/
|
||||
public function useFormattedMessage($value)
|
||||
{
|
||||
|
@@ -50,7 +50,7 @@ class RavenHandler extends AbstractProcessingHandler
|
||||
|
||||
/**
|
||||
* @param Raven_Client $ravenClient
|
||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||
* @param int $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
|
||||
*/
|
||||
public function __construct(Raven_Client $ravenClient, $level = Logger::DEBUG, $bubble = true)
|
||||
|
@@ -34,9 +34,9 @@ class RedisHandler extends AbstractProcessingHandler
|
||||
/**
|
||||
* @param \Predis\Client|\Redis $redis The redis instance
|
||||
* @param string $key The key name to push records to
|
||||
* @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 integer $capSize Number of entries to limit list size to
|
||||
* @param int $level The minimum logging level at which this handler will be triggered
|
||||
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
||||
* @param int $capSize Number of entries to limit list size to
|
||||
*/
|
||||
public function __construct($redis, $key, $level = Logger::DEBUG, $bubble = true, $capSize = false)
|
||||
{
|
||||
@@ -67,7 +67,7 @@ class RedisHandler extends AbstractProcessingHandler
|
||||
* Write and cap the collection
|
||||
* Writes the record to the redis list and caps its
|
||||
*
|
||||
* @param array $record associative record array
|
||||
* @param array $record associative record array
|
||||
* @return void
|
||||
*/
|
||||
protected function writeCapped(array $record)
|
||||
|
@@ -38,8 +38,8 @@ class RollbarHandler extends AbstractProcessingHandler
|
||||
|
||||
/**
|
||||
* @param RollbarNotifier $rollbarNotifier RollbarNotifier object constructed with valid token
|
||||
* @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 int $level The minimum logging level at which this handler will be triggered
|
||||
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
||||
*/
|
||||
public function __construct(RollbarNotifier $rollbarNotifier, $level = Logger::ERROR, $bubble = true)
|
||||
{
|
||||
|
@@ -33,8 +33,8 @@ class RotatingFileHandler extends StreamHandler
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @param integer $maxFiles The maximal amount of files to keep (0 means unlimited)
|
||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||
* @param int $maxFiles The maximal amount of files to keep (0 means unlimited)
|
||||
* @param int $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 int|null $filePermission Optional file permissions (default (0644) are only for owner read/write)
|
||||
* @param Boolean $useLocking Try to lock log file before doing any writes
|
||||
|
@@ -70,16 +70,16 @@ class SlackHandler extends SocketHandler
|
||||
private $lineFormatter;
|
||||
|
||||
/**
|
||||
* @param string $token Slack API token
|
||||
* @param string $channel Slack channel (encoded ID or name)
|
||||
* @param string $username Name of a bot
|
||||
* @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise)
|
||||
* @param string|null $iconEmoji The emoji name to use (or null)
|
||||
* @param int $level The minimum logging level at which this handler will be triggered
|
||||
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
||||
* @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style
|
||||
* @param bool $includeContextAndExtra Whether the attachment should include context and extra data
|
||||
* @throws MissingExtensionException If no OpenSSL PHP extension configured
|
||||
* @param string $token Slack API token
|
||||
* @param string $channel Slack channel (encoded ID or name)
|
||||
* @param string $username Name of a bot
|
||||
* @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise)
|
||||
* @param string|null $iconEmoji The emoji name to use (or null)
|
||||
* @param int $level The minimum logging level at which this handler will be triggered
|
||||
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
||||
* @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style
|
||||
* @param bool $includeContextAndExtra Whether the attachment should include context and extra data
|
||||
* @throws MissingExtensionException If no OpenSSL PHP extension configured
|
||||
*/
|
||||
public function __construct($token, $channel, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false)
|
||||
{
|
||||
@@ -140,14 +140,14 @@ class SlackHandler extends SocketHandler
|
||||
'channel' => $this->channel,
|
||||
'username' => $this->username,
|
||||
'text' => '',
|
||||
'attachments' => array()
|
||||
'attachments' => array(),
|
||||
);
|
||||
|
||||
if ($this->useAttachment) {
|
||||
$attachment = array(
|
||||
'fallback' => $record['message'],
|
||||
'color' => $this->getAttachmentColor($record['level']),
|
||||
'fields' => array()
|
||||
'fields' => array(),
|
||||
);
|
||||
|
||||
if ($this->useShortAttachment) {
|
||||
@@ -159,7 +159,7 @@ class SlackHandler extends SocketHandler
|
||||
$attachment['fields'][] = array(
|
||||
'title' => 'Level',
|
||||
'value' => $record['level_name'],
|
||||
'short' => true
|
||||
'short' => true,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ class SlackHandler extends SocketHandler
|
||||
$attachment['fields'][] = array(
|
||||
'title' => "Extra",
|
||||
'value' => $this->stringify($record['extra']),
|
||||
'short' => $this->useShortAttachment
|
||||
'short' => $this->useShortAttachment,
|
||||
);
|
||||
} else {
|
||||
// Add all extra fields as individual fields in attachment
|
||||
@@ -177,7 +177,7 @@ class SlackHandler extends SocketHandler
|
||||
$attachment['fields'][] = array(
|
||||
'title' => $var,
|
||||
'value' => $val,
|
||||
'short' => $this->useShortAttachment
|
||||
'short' => $this->useShortAttachment,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -188,7 +188,7 @@ class SlackHandler extends SocketHandler
|
||||
$attachment['fields'][] = array(
|
||||
'title' => "Context",
|
||||
'value' => $this->stringify($record['context']),
|
||||
'short' => $this->useShortAttachment
|
||||
'short' => $this->useShortAttachment,
|
||||
);
|
||||
} else {
|
||||
// Add all context fields as individual fields in attachment
|
||||
@@ -196,7 +196,7 @@ class SlackHandler extends SocketHandler
|
||||
$attachment['fields'][] = array(
|
||||
'title' => $var,
|
||||
'value' => $val,
|
||||
'short' => $this->useShortAttachment
|
||||
'short' => $this->useShortAttachment,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -267,8 +267,7 @@ class SlackHandler extends SocketHandler
|
||||
/**
|
||||
* Stringifies an array of key/value pairs to be used in attachment fields
|
||||
*
|
||||
* @param array $fields
|
||||
* @access protected
|
||||
* @param array $fields
|
||||
* @return string
|
||||
*/
|
||||
protected function stringify($fields)
|
||||
|
@@ -33,7 +33,7 @@ class SocketHandler extends AbstractProcessingHandler
|
||||
|
||||
/**
|
||||
* @param string $connectionString Socket connection string
|
||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||
* @param int $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
|
||||
*/
|
||||
public function __construct($connectionString, $level = Logger::DEBUG, $bubble = true)
|
||||
@@ -82,7 +82,7 @@ class SocketHandler extends AbstractProcessingHandler
|
||||
/**
|
||||
* Set socket connection to nbe persistent. It only has effect before the connection is initiated.
|
||||
*
|
||||
* @param boolean $persistent
|
||||
* @param bool $persistent
|
||||
*/
|
||||
public function setPersistent($persistent)
|
||||
{
|
||||
@@ -118,8 +118,7 @@ class SocketHandler extends AbstractProcessingHandler
|
||||
/**
|
||||
* Set writing timeout. Only has effect during connection in the writing cycle.
|
||||
*
|
||||
* @param float $seconds 0 for no timeout
|
||||
*
|
||||
* @param float $seconds 0 for no timeout
|
||||
*/
|
||||
public function setWritingTimeout($seconds)
|
||||
{
|
||||
@@ -140,7 +139,7 @@ class SocketHandler extends AbstractProcessingHandler
|
||||
/**
|
||||
* Get persistent setting
|
||||
*
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
public function isPersistent()
|
||||
{
|
||||
@@ -182,7 +181,7 @@ class SocketHandler extends AbstractProcessingHandler
|
||||
*
|
||||
* UDP might appear to be connected but might fail when writing. See http://php.net/fsockopen for details.
|
||||
*
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
public function isConnected()
|
||||
{
|
||||
@@ -329,6 +328,7 @@ class SocketHandler extends AbstractProcessingHandler
|
||||
|
||||
if ((time() - $this->lastWritingAt) >= $writingTimeout) {
|
||||
$this->closeSocket();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -31,7 +31,7 @@ class StreamHandler extends AbstractProcessingHandler
|
||||
|
||||
/**
|
||||
* @param resource|string $stream
|
||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||
* @param int $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 int|null $filePermission Optional file permissions (default (0644) are only for owner read/write)
|
||||
* @param Boolean $useLocking Try to lock log file before doing any writes
|
||||
|
@@ -26,7 +26,7 @@ class SwiftMailerHandler extends MailHandler
|
||||
/**
|
||||
* @param \Swift_Mailer $mailer The mailer to use
|
||||
* @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced
|
||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||
* @param int $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
|
||||
*/
|
||||
public function __construct(\Swift_Mailer $mailer, $message, $level = Logger::ERROR, $bubble = true)
|
||||
@@ -48,8 +48,8 @@ class SwiftMailerHandler extends MailHandler
|
||||
/**
|
||||
* Creates instance of Swift_Message to be sent
|
||||
*
|
||||
* @param string $content formatted email body to be sent
|
||||
* @param array $records Log records that formed the content
|
||||
* @param string $content formatted email body to be sent
|
||||
* @param array $records Log records that formed the content
|
||||
* @return \Swift_Message
|
||||
*/
|
||||
protected function buildMessage($content, array $records)
|
||||
|
@@ -34,7 +34,7 @@ class SyslogHandler extends AbstractSyslogHandler
|
||||
/**
|
||||
* @param string $ident
|
||||
* @param mixed $facility
|
||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||
* @param int $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 int $logopts Option flags for the openlog() call, defaults to LOG_PID
|
||||
*/
|
||||
|
@@ -27,7 +27,7 @@ class SyslogUdpHandler extends AbstractSyslogHandler
|
||||
* @param string $host
|
||||
* @param int $port
|
||||
* @param mixed $facility
|
||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||
* @param int $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
|
||||
*/
|
||||
public function __construct($host, $port = 514, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true)
|
||||
|
Reference in New Issue
Block a user