1
0
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:
Jordi Boggiano
2019-09-05 14:38:58 +02:00
5 changed files with 13 additions and 7 deletions

View File

@@ -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')
;

View File

@@ -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"
]
},

View File

@@ -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 = [

View File

@@ -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

View File

@@ -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',
],