diff --git a/.php_cs b/.php_cs index 6fc3ca2e..8d8b2b5d 100644 --- a/.php_cs +++ b/.php_cs @@ -13,6 +13,12 @@ $finder = PhpCsFixer\Finder::create() ->files() ->name('*.php') ->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__.'/tests') ; diff --git a/composer.json b/composer.json index 21d80648..2f87c391 100644 --- a/composer.json +++ b/composer.json @@ -61,7 +61,7 @@ }, "scripts": { "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" ] }, diff --git a/src/Monolog/Handler/ChromePHPHandler.php b/src/Monolog/Handler/ChromePHPHandler.php index 8f35e199..f391a90d 100644 --- a/src/Monolog/Handler/ChromePHPHandler.php +++ b/src/Monolog/Handler/ChromePHPHandler.php @@ -46,7 +46,7 @@ class ChromePHPHandler extends AbstractProcessingHandler /** * 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 */ @@ -146,7 +146,7 @@ class ChromePHPHandler extends AbstractProcessingHandler $json = @json_encode(self::$json); $data = base64_encode(utf8_encode($json)); - if (strlen($data) > 240 * 1024) { + if (strlen($data) > 3 * 1024) { self::$overflowed = true; $record = [ diff --git a/src/Monolog/Handler/InsightOpsHandler.php b/src/Monolog/Handler/InsightOpsHandler.php index 1f6d41fc..5ddc66bd 100644 --- a/src/Monolog/Handler/InsightOpsHandler.php +++ b/src/Monolog/Handler/InsightOpsHandler.php @@ -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) { 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 diff --git a/tests/Monolog/Handler/ChromePHPHandlerTest.php b/tests/Monolog/Handler/ChromePHPHandlerTest.php index 42c0c559..1ee58195 100644 --- a/tests/Monolog/Handler/ChromePHPHandlerTest.php +++ b/tests/Monolog/Handler/ChromePHPHandlerTest.php @@ -66,10 +66,10 @@ class ChromePHPHandlerTest extends TestCase { $handler = new TestChromePHPHandler(); $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 - $handler->handle($this->getRecord(Logger::WARNING, str_repeat('a', 100 * 1024))); + $handler->handle($this->getRecord(Logger::WARNING, str_repeat('b', 2 * 1024))); $expected = [ 'X-ChromeLogger-Data' => base64_encode(utf8_encode(json_encode([ @@ -84,7 +84,7 @@ class ChromePHPHandlerTest extends TestCase ], [ 'test', - str_repeat('a', 150 * 1024), + str_repeat('a', 2 * 1024), 'unknown', 'warn', ],