mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-04 20:27:31 +02:00
Merge branch '1.x'
This commit is contained in:
@@ -31,13 +31,13 @@ class LogEntriesHandler extends SocketHandler
|
|||||||
*
|
*
|
||||||
* @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing
|
* @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing
|
||||||
*/
|
*/
|
||||||
public function __construct($token, $useSSL = true, $level = Logger::DEBUG, bool $bubble = true)
|
public function __construct($token, $useSSL = true, $level = Logger::DEBUG, bool $bubble = true, string $host = 'data.logentries.com')
|
||||||
{
|
{
|
||||||
if ($useSSL && !extension_loaded('openssl')) {
|
if ($useSSL && !extension_loaded('openssl')) {
|
||||||
throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for LogEntriesHandler');
|
throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for LogEntriesHandler');
|
||||||
}
|
}
|
||||||
|
|
||||||
$endpoint = $useSSL ? 'ssl://data.logentries.com:443' : 'data.logentries.com:80';
|
$endpoint = $useSSL ? 'ssl://' . $host . ':443' : $host . ':80';
|
||||||
parent::__construct($endpoint, $level, $bubble);
|
parent::__construct($endpoint, $level, $bubble);
|
||||||
$this->logToken = $token;
|
$this->logToken = $token;
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ class RavenHandler extends AbstractProcessingHandler
|
|||||||
/**
|
/**
|
||||||
* Translates Monolog log levels to Raven log levels.
|
* Translates Monolog log levels to Raven log levels.
|
||||||
*/
|
*/
|
||||||
private $logLevels = [
|
protected $logLevels = [
|
||||||
Logger::DEBUG => Raven_Client::DEBUG,
|
Logger::DEBUG => Raven_Client::DEBUG,
|
||||||
Logger::INFO => Raven_Client::INFO,
|
Logger::INFO => Raven_Client::INFO,
|
||||||
Logger::NOTICE => Raven_Client::INFO,
|
Logger::NOTICE => Raven_Client::INFO,
|
||||||
@@ -41,13 +41,13 @@ class RavenHandler extends AbstractProcessingHandler
|
|||||||
/**
|
/**
|
||||||
* @var string the current application environment (staging|preprod|prod)
|
* @var string the current application environment (staging|preprod|prod)
|
||||||
*/
|
*/
|
||||||
private $environment;
|
protected $environment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string should represent the current version of the calling
|
* @var string should represent the current version of the calling
|
||||||
* software. Can be any string (git commit, version number)
|
* software. Can be any string (git commit, version number)
|
||||||
*/
|
*/
|
||||||
private $release;
|
protected $release;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Raven_Client the client object that sends the message to the server
|
* @var Raven_Client the client object that sends the message to the server
|
||||||
@@ -226,7 +226,7 @@ class RavenHandler extends AbstractProcessingHandler
|
|||||||
*/
|
*/
|
||||||
protected function getExtraParameters(): array
|
protected function getExtraParameters(): array
|
||||||
{
|
{
|
||||||
return ['checksum', 'release', 'environment', 'event_id'];
|
return ['contexts', 'checksum', 'release', 'environment', 'event_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -19,7 +19,7 @@ use Monolog\Logger;
|
|||||||
* @author Nick Otter
|
* @author Nick Otter
|
||||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||||
*/
|
*/
|
||||||
class GitProcessor
|
class GitProcessor implements ProcessorInterface
|
||||||
{
|
{
|
||||||
private $level;
|
private $level;
|
||||||
private static $cache;
|
private static $cache;
|
||||||
|
@@ -24,7 +24,7 @@ use Monolog\Logger;
|
|||||||
*
|
*
|
||||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||||
*/
|
*/
|
||||||
class IntrospectionProcessor
|
class IntrospectionProcessor implements ProcessorInterface
|
||||||
{
|
{
|
||||||
private $level;
|
private $level;
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@ namespace Monolog\Processor;
|
|||||||
*
|
*
|
||||||
* @author Rob Jensen
|
* @author Rob Jensen
|
||||||
*/
|
*/
|
||||||
abstract class MemoryProcessor
|
abstract class MemoryProcessor implements ProcessorInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var bool If true, get the real size of memory allocated from system. Else, only the memory used by emalloc() is reported.
|
* @var bool If true, get the real size of memory allocated from system. Else, only the memory used by emalloc() is reported.
|
||||||
|
@@ -18,7 +18,7 @@ use Monolog\Logger;
|
|||||||
*
|
*
|
||||||
* @author Jonathan A. Schweder <jonathanschweder@gmail.com>
|
* @author Jonathan A. Schweder <jonathanschweder@gmail.com>
|
||||||
*/
|
*/
|
||||||
class MercurialProcessor
|
class MercurialProcessor implements ProcessorInterface
|
||||||
{
|
{
|
||||||
private $level;
|
private $level;
|
||||||
private static $cache;
|
private static $cache;
|
||||||
|
@@ -16,7 +16,7 @@ namespace Monolog\Processor;
|
|||||||
*
|
*
|
||||||
* @author Andreas Hörnicke
|
* @author Andreas Hörnicke
|
||||||
*/
|
*/
|
||||||
class ProcessIdProcessor
|
class ProcessIdProcessor implements ProcessorInterface
|
||||||
{
|
{
|
||||||
public function __invoke(array $record): array
|
public function __invoke(array $record): array
|
||||||
{
|
{
|
||||||
|
25
src/Monolog/Processor/ProcessorInterface.php
Normal file
25
src/Monolog/Processor/ProcessorInterface.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Monolog\Processor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An optional interface to allow labelling Monolog processors.
|
||||||
|
*
|
||||||
|
* @author Nicolas Grekas <p@tchwork.com>
|
||||||
|
*/
|
||||||
|
interface ProcessorInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @return array The processed records
|
||||||
|
*/
|
||||||
|
public function __invoke(array $records);
|
||||||
|
}
|
@@ -18,7 +18,7 @@ namespace Monolog\Processor;
|
|||||||
*
|
*
|
||||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||||
*/
|
*/
|
||||||
class PsrLogMessageProcessor
|
class PsrLogMessageProcessor implements ProcessorInterface
|
||||||
{
|
{
|
||||||
const SIMPLE_DATE = "Y-m-d\TH:i:s.uP";
|
const SIMPLE_DATE = "Y-m-d\TH:i:s.uP";
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@ namespace Monolog\Processor;
|
|||||||
*
|
*
|
||||||
* @author Martijn Riemers
|
* @author Martijn Riemers
|
||||||
*/
|
*/
|
||||||
class TagProcessor
|
class TagProcessor implements ProcessorInterface
|
||||||
{
|
{
|
||||||
private $tags;
|
private $tags;
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@ namespace Monolog\Processor;
|
|||||||
*
|
*
|
||||||
* @author Simon Mönch <sm@webfactory.de>
|
* @author Simon Mönch <sm@webfactory.de>
|
||||||
*/
|
*/
|
||||||
class UidProcessor
|
class UidProcessor implements ProcessorInterface
|
||||||
{
|
{
|
||||||
private $uid;
|
private $uid;
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@ namespace Monolog\Processor;
|
|||||||
*
|
*
|
||||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||||
*/
|
*/
|
||||||
class WebProcessor
|
class WebProcessor implements ProcessorInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var array|\ArrayAccess
|
* @var array|\ArrayAccess
|
||||||
|
Reference in New Issue
Block a user