mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 08:05:53 +03:00
[PR #4] [MERGED] add new SyslogHandler class #868
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#868
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Seldaek/monolog/pull/4
Author: @subsven
Created: 3/22/2011
Status: ✅ Merged
Merged: 3/23/2011
Merged by: @Seldaek
Base:
master← Head:master📝 Commits (2)
d9d0f51add SyslogHandler to Monolog38a4ddfremove LOG_NDELAY from the openlog() call since the expected behaviour📊 Changes
2 files changed (+130 additions, -0 deletions)
View changed files
➕
src/Monolog/Handler/SyslogHandler.php(+93 -0)➕
tests/Monolog/Handler/SyslogHandlerTest.php(+37 -0)📄 Description
Since there is currently no syslog support in Monolog (and it even was on your todo list :-) ) here is a new SyslogHandler class.
A basic usage example:
The special formatter is needed since the timestamp is included automatically in all syslog messages.
The facility can be given using PHP constants (LOG_LOCAL5) or by string ('local5') to simplify setting the values from a configuration file.
I couldn't think of any unit test approaches for actually writing the message since mocking the syslog() function isn't possible and all tests using the real syslog() function would depend on a special syslogd configuration. So currently the unit tests only cover the constructor.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.