You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-dev@logging.apache.org by "Rony Cesana (JIRA)" <ji...@apache.org> on 2011/07/13 16:21:00 UTC
[jira] [Commented] (LOG4PHP-126) LoggerConfiguratorPhp does not
appear to respect appender file property from config
[ https://issues.apache.org/jira/browse/LOG4PHP-126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064579#comment-13064579 ]
Rony Cesana commented on LOG4PHP-126:
-------------------------------------
Hello everyone, I think I have a solution that seems slightly more general.
In facts I think there were two issues: all of the property definitions were ignored, and the activation method was not called on the appenders.
After line #86, I added:
foreach ($appenderProperties as $name => $value) {
if ($name == 'class' || $name == 'layout') {
continue;
}
LoggerReflectionUtils::setter($appender, $name, $value);
}
$appender->activateOptions();
Hope this helps.
> LoggerConfiguratorPhp does not appear to respect appender file property from config
> -----------------------------------------------------------------------------------
>
> Key: LOG4PHP-126
> URL: https://issues.apache.org/jira/browse/LOG4PHP-126
> Project: Log4php
> Issue Type: Bug
> Components: Code
> Affects Versions: 2.0
> Environment: all
> Reporter: Peter Chapman
> Fix For: 2.1
>
>
> When setting a log file path in an appender block within the php config array, the LoggerConfiguratorPhp::doConfigure does not respect this property.
> I have resolved the issue by adding the following code to the LoggerConfiguratorPhp class after line #80:
> if(isset($appenderProperties['file']) && method_exists($appender, 'setFileName')) {
> $appender->setFile($appenderProperties['file'], true);
> }
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira