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

Already on GitHub? Sign in to your account

Allow passing of openlog() options in SyslogHandler ctor #109

Merged
merged 2 commits into from Aug 29, 2012

Conversation

Projects
None yet
4 participants
Contributor

dzuelke commented Aug 29, 2012

Hardcoded to LOG_PID right now, and I need different settings in a project :)

This pull request passes (merged 76fb21b into 75af99d).

@stof stof commented on an outdated diff Aug 29, 2012

src/Monolog/Handler/SyslogHandler.php
@@ -67,7 +67,7 @@ class SyslogHandler extends AbstractProcessingHandler
* @param integer $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
*/
- public function __construct($ident, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true)
+ public function __construct($ident, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true, $logopts = LOG_PID)
@stof

stof Aug 29, 2012

Contributor

you need to update the phpdoc too

@stof stof commented on the diff Aug 29, 2012

tests/Monolog/Handler/SyslogHandlerTest.php
@@ -26,6 +27,9 @@ public function testConstruct()
$handler = new SyslogHandler('test', 'user');
$this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler);
+
+ $handler = new SyslogHandler('test', LOG_USER, Logger::DEBUG, true, LOG_PERROR);
+ $this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler);
@stof

stof Aug 29, 2012

Contributor

This does not test anything: this test will also pass with the current code as PHP does not complain about extra arguments :)

@dzuelke

dzuelke Aug 29, 2012

Contributor

Yes, but that's true for the other tests in there as well...

This pull request passes (merged 1feffd3 into 75af99d).

@Seldaek Seldaek added a commit that referenced this pull request Aug 29, 2012

@Seldaek Seldaek Merge pull request #109 from dzuelke/openlog
Allow passing of openlog() options in SyslogHandler ctor
2c4c792

@Seldaek Seldaek merged commit 2c4c792 into Seldaek:master Aug 29, 2012

Owner

Seldaek commented Aug 29, 2012

Merged thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment