Skip to content

Create PEAR System_Daemon handler #356

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

Closed
wants to merge 1 commit into from
Closed

Create PEAR System_Daemon handler #356

wants to merge 1 commit into from

Conversation

henriquemoody
Copy link
Contributor

System_Daemon is an very stable package to work with daemons in PHP. It already handles logs by itself this pull request aims to integrate System_Daemon and Monolog.
A default formatter was created, since System_Daemon already prefix the date and level to the log message there is no need to duplicate this information, SystemDaemonFormatter is based on LineFormatter but has only channel, message, context and extras.

@Seldaek Seldaek added this to the 2.0 milestone Apr 20, 2014
@henriquemoody
Copy link
Contributor Author

I removed SystemDaemonFormatter in favor of use LineFormatter with a different argument on constructor.

@Seldaek
Copy link
Owner

Seldaek commented Apr 20, 2014

Not sure what the point is here. This forwards logs to a system daemon log it seems. Is there a real use case or is it just for BC support for old apps or something?

@henriquemoody
Copy link
Contributor Author

I have used this handler when writing/maintaining daemons with System_Daemon.
System_Daemon forces to define a file to write logs but it only write logs on this file. Using Monolog and defining System_Daemon as a handler:

  • I have a better API;
  • I don't need to call System_Daemon and Monolog to write the same message

I sent this pull request because I think other people may want it as me, but if you judge it only as a mine necessity I will understand.

@Seldaek
Copy link
Owner

Seldaek commented Apr 20, 2014

The thing is I am trying to avoid new optional dependencies since I'd like to move all optional deps into separate packages for 2.0, so I think it'd be better if you create a new package for this, feel free to call it monolog/system-daemon-handler, and it can require monolog/monolog + pear/system_daemon explicitly, so there are no optional dependencies to add for users, they just require your handler package if they want to use it.

@Seldaek Seldaek closed this Apr 20, 2014
@henriquemoody
Copy link
Contributor Author

Looks great for me! Thanks.

@henriquemoody
Copy link
Contributor Author

I will copy Monolog\TestCase, but I think people will like if you move it to "src/" directory or create a Monolog\Test namespace on the future...

@Seldaek
Copy link
Owner

Seldaek commented Apr 20, 2014

Yup it probably should be moved to the src dir to allow re-use. I'll add it to the 2.0 notes thanks.

@Seldaek Seldaek mentioned this pull request Apr 20, 2014
30 tasks
@henriquemoody henriquemoody deleted the system_daemon branch May 12, 2014 15:19
@harikt
Copy link
Contributor

harikt commented May 20, 2014

@Seldaek one doubt when reading the v2 changes I came to here.

Does this means you are planning to move all tests to src folder ?

@Seldaek
Copy link
Owner

Seldaek commented May 20, 2014

@harikt nope, just the TestCase since it could be reused by standalone handler libs.

@harikt
Copy link
Contributor

harikt commented May 20, 2014

Thank you @Seldaek .

@Taluu
Copy link

Taluu commented Oct 14, 2014

Just like @harikt, just came here because I saw the #197 task list.

I don't really get the point of moving the TestCase in the src folder, as it is a helper for the tests and is already loadable by PSR-4 (Hence a correct namespace Monolog\TestCase)... If we leave it alone, I don't really see what is preventing standalone handler libs to use the TestCase, as it should already need to load monolog\monolog anyway ?

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.

4 participants