mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-05 12:47:39 +02:00
Merge branch '1.x'
This commit is contained in:
6
.php_cs
6
.php_cs
@@ -13,6 +13,12 @@ $finder = PhpCsFixer\Finder::create()
|
|||||||
->files()
|
->files()
|
||||||
->name('*.php')
|
->name('*.php')
|
||||||
->exclude('Fixtures')
|
->exclude('Fixtures')
|
||||||
|
// The next 4 files are here for forward compatibility, and are not used by
|
||||||
|
// Monolog itself
|
||||||
|
->exclude(__DIR__.'src/Monolog/Handler/FormattableHandlerInterface.php')
|
||||||
|
->exclude(__DIR__.'src/Monolog/Handler/FormattableHandlerTrait.php')
|
||||||
|
->exclude(__DIR__.'src/Monolog/Handler/ProcessableHandlerInterface.php')
|
||||||
|
->exclude(__DIR__.'src/Monolog/Handler/ProcessableHandlerTrait.php')
|
||||||
->in(__DIR__.'/src')
|
->in(__DIR__.'/src')
|
||||||
->in(__DIR__.'/tests')
|
->in(__DIR__.'/tests')
|
||||||
;
|
;
|
||||||
|
@@ -61,7 +61,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": [
|
"test": [
|
||||||
"parallel-lint . --exclude vendor",
|
"parallel-lint . --exclude vendor --exclude src/Monolog/Handler/FormattableHandlerInterface.php --exclude src/Monolog/Handler/FormattableHandlerTrait.php --exclude src/Monolog/Handler/ProcessableHandlerInterface.php --exclude src/Monolog/Handler/ProcessableHandlerTrait.php",
|
||||||
"phpunit"
|
"phpunit"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@@ -46,7 +46,7 @@ class ChromePHPHandler extends AbstractProcessingHandler
|
|||||||
/**
|
/**
|
||||||
* Tracks whether we sent too much data
|
* Tracks whether we sent too much data
|
||||||
*
|
*
|
||||||
* Chrome limits the headers to 256KB, so when we sent 240KB we stop sending
|
* Chrome limits the headers to 4KB, so when we sent 3KB we stop sending
|
||||||
*
|
*
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
@@ -146,7 +146,7 @@ class ChromePHPHandler extends AbstractProcessingHandler
|
|||||||
|
|
||||||
$json = @json_encode(self::$json);
|
$json = @json_encode(self::$json);
|
||||||
$data = base64_encode(utf8_encode($json));
|
$data = base64_encode(utf8_encode($json));
|
||||||
if (strlen($data) > 240 * 1024) {
|
if (strlen($data) > 3 * 1024) {
|
||||||
self::$overflowed = true;
|
self::$overflowed = true;
|
||||||
|
|
||||||
$record = [
|
$record = [
|
||||||
|
@@ -38,7 +38,7 @@ class InsightOpsHandler extends SocketHandler
|
|||||||
public function __construct(string $token, string $region = 'us', bool $useSSL = true, $level = Logger::DEBUG, bool $bubble = true)
|
public function __construct(string $token, string $region = 'us', bool $useSSL = true, $level = Logger::DEBUG, bool $bubble = true)
|
||||||
{
|
{
|
||||||
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 InsightOpsHandler');
|
||||||
}
|
}
|
||||||
|
|
||||||
$endpoint = $useSSL
|
$endpoint = $useSSL
|
||||||
|
@@ -66,10 +66,10 @@ class ChromePHPHandlerTest extends TestCase
|
|||||||
{
|
{
|
||||||
$handler = new TestChromePHPHandler();
|
$handler = new TestChromePHPHandler();
|
||||||
$handler->handle($this->getRecord(Logger::DEBUG));
|
$handler->handle($this->getRecord(Logger::DEBUG));
|
||||||
$handler->handle($this->getRecord(Logger::WARNING, str_repeat('a', 150 * 1024)));
|
$handler->handle($this->getRecord(Logger::WARNING, str_repeat('a', 2 * 1024)));
|
||||||
|
|
||||||
// overflow chrome headers limit
|
// overflow chrome headers limit
|
||||||
$handler->handle($this->getRecord(Logger::WARNING, str_repeat('a', 100 * 1024)));
|
$handler->handle($this->getRecord(Logger::WARNING, str_repeat('b', 2 * 1024)));
|
||||||
|
|
||||||
$expected = [
|
$expected = [
|
||||||
'X-ChromeLogger-Data' => base64_encode(utf8_encode(json_encode([
|
'X-ChromeLogger-Data' => base64_encode(utf8_encode(json_encode([
|
||||||
@@ -84,7 +84,7 @@ class ChromePHPHandlerTest extends TestCase
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
'test',
|
'test',
|
||||||
str_repeat('a', 150 * 1024),
|
str_repeat('a', 2 * 1024),
|
||||||
'unknown',
|
'unknown',
|
||||||
'warn',
|
'warn',
|
||||||
],
|
],
|
||||||
|
Reference in New Issue
Block a user