Skip to content

Commit 26a29b9

Browse files
committed
feature #473 Add service definition for SyslogFormatter (sarim)
This PR was merged into the 3.x branch. Discussion ---------- Add service definition for SyslogFormatter | Q | A | ------------- | --- | Branch? | 3.x | Bug fix? | no | New feature? | yes | Deprecations? | no | Issues | Fix #441 | License | MIT From symfony/recipes#1111 & Seldaek/monolog#1689 I found out about the (newish) syslog formatter that can be viewed nicely with lnav. While trying to use it, I see there is no service created for this in monolog-bundle. Users can obviously make their own service in their app's services.yaml, but seeing other formatters exposed and discussion about adding it via recipe, I thought it would be good idea to create the service from monolog-bundle. Commits ------- 8996d60 Add service definition for SyslogFormatter
2 parents c8d9bf0 + 8996d60 commit 26a29b9

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* Add `enabled` option to `handlers` configuration
1919
* Add `priority` field to `processor` tag
2020
* Add `mongodb` handler and deprecate `mongo`
21+
* Add `monolog.formatter.syslog` service definition to format RFC5424-compliant messages
2122

2223
## 3.10.0 (2023-11-06)
2324

config/monolog.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Monolog\Formatter\LogstashFormatter;
2121
use Monolog\Formatter\NormalizerFormatter;
2222
use Monolog\Formatter\ScalarFormatter;
23+
use Monolog\Formatter\SyslogFormatter;
2324
use Monolog\Formatter\WildfireFormatter;
2425
use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy;
2526
use Monolog\Logger;
@@ -55,6 +56,7 @@
5556
->set('monolog.formatter.html', HtmlFormatter::class)
5657
->set('monolog.formatter.json', JsonFormatter::class)
5758
->set('monolog.formatter.line', LineFormatter::class)
59+
->set('monolog.formatter.syslog', SyslogFormatter::class)
5860
->set('monolog.formatter.loggly', LogglyFormatter::class)
5961
->set('monolog.formatter.normalizer', NormalizerFormatter::class)
6062
->set('monolog.formatter.scalar', ScalarFormatter::class)

0 commit comments

Comments
 (0)