Skip to content

Commit

Permalink
Merge branch 'Seldaek:main' into include-extra-in-psr-handler
Browse files Browse the repository at this point in the history
  • Loading branch information
snapshotpl authored Jan 31, 2024
2 parents b41aecd + 479c936 commit 14bc922
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
/_config.yml export-ignore
/UPGRADE.md export-ignore
/.editorconfig export-ignore
/favicon.ico export-ignore
/logo.jpg export-ignore
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ composer.lock
.hg
.phpunit.result.cache
.phpunit.cache
favicon.ico
logo.jpg
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ make sure you can always use another compatible logger at a later time.
As of 1.11.0 Monolog public APIs will also accept PSR-3 log levels.
Internally Monolog still uses its own level scheme since it predates PSR-3.

<div align="center">
<hr>
<sup><b>Sponsored by:</b></sup>
<br>
<a href="https://betterstack.com">
<div>
<img src="https://github.com/Seldaek/monolog/assets/183678/7de58ce0-2fa2-45c0-b3e8-e60cebb3c4cf" width="200" alt="Better Stack">
</div>
<div>
Better Stack lets you centralize, search, and visualize your logs.
</div>
</a>
<br>
<hr>
</div>

## Installation

Install the latest version with
Expand Down
1 change: 1 addition & 0 deletions doc/04-extending.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ abstract class provided by Monolog to keep things DRY.

use Monolog\Level;
use Monolog\Logger;
use Monolog\LogRecord;
use Monolog\Handler\AbstractProcessingHandler;

class PDOHandler extends AbstractProcessingHandler
Expand Down
2 changes: 0 additions & 2 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ parameters:
ignoreErrors:
- '#zend_monitor_|ZEND_MONITOR_#'
- '#MongoDB\\(Client|Collection)#'
# Invalid type info on Redis multi
- '#^Cannot call method ltrim\(\) on int\|false.$#'

# Cannot resolve this cleanly as different normalizers return different types but it is safe
- message: '#Return type \(string\) of method Monolog\\Formatter\\LineFormatter::normalizeException\(\) should be compatible with return type \(array\) of method Monolog\\Formatter\\NormalizerFormatter::normalizeException\(\)#'
Expand Down
2 changes: 1 addition & 1 deletion src/Monolog/Handler/RedisHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected function writeCapped(LogRecord $record): void
$mode = defined('Redis::MULTI') ? Redis::MULTI : 1;
$this->redisClient->multi($mode)
->rPush($this->redisKey, $record->formatted)
->ltrim($this->redisKey, -$this->capSize, -1)
->lTrim($this->redisKey, -$this->capSize, -1)
->exec();
} else {
$redisKey = $this->redisKey;
Expand Down

0 comments on commit 14bc922

Please sign in to comment.