Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SystemdJournalHandler #564

Closed
wants to merge 1 commit into from

Conversation

dnohales
Copy link

I just wanted to propose a handler to log to systemd-journal service, this is going to give us all the benefits of this service (better search and indexing, better integration with the OS, richer metadata for log records).

To use it, you're gonna need to have php-systemd extension installed in your system.

I have one concern for this PR though, I had to make checkSystemdExtension and sendToJournal public methods instead of private or protected to make it easy to mock in the tests (we don't want for sure to send real log records during test execution). I could wrap those methods functionality in a separated class but it looked like too much just for test cases stuff. You tell me :)

Thanks!

/**
* Check if the php-systemd extension is properly enabled.
*/
public function checkSystemdExtension()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need this method? why not just inline this code in __construct()?

@Seldaek
Copy link
Owner

Seldaek commented Jun 1, 2015

Thanks for the PR, but as I am trying to reduce the amount of core handlers I have to support and especially don't want to add more optional dependencies, I think you should rather release this as a standalone handler so that you can require the systemd extension explicitly and then add it to https://github.com/Seldaek/monolog/wiki/Third-Party-Packages

@Seldaek Seldaek closed this Jun 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants