Loading...

log4php-dev@logging.apache.org

[Prev] Thread [Next]  |  [Prev] Date [Next]

[jira] [Commented] (LOG4PHP-170) Configuring a file or echo appender programmatically will not show context printing despite setting the value to TRUE Wes Oden (Commented) (JIRA) Wed Feb 22 12:00:48 2012

    [ 
https://issues.apache.org/jira/browse/LOG4PHP-170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13213895#comment-13213895
 ] 

Wes Oden commented on LOG4PHP-170:
----------------------------------

Ah, good to know.  Sorry for the issue report then.  I think we're mostly going 
to be using database-based logging, anyhow, so I won't really need the 
file/line info in a file log, but the echo log will be handy to have that 
information in.  Also, can anyone provide more information on how to buffer the 
output of the echo logger?  I saw in the documentation that it is possible, but 
no example was given, and the API documentation makes no mention of how to 
buffer.

Thanks for your help.
-wes
                
> Configuring a file or echo appender programmatically will not show context 
> printing despite setting the value to TRUE
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: LOG4PHP-170
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-170
>             Project: Log4php
>          Issue Type: Bug
>            Reporter: Wes Oden
>            Priority: Minor
>
> $logger = Logger::getLogger("example_echo");
> $appender = new LoggerAppenderEcho('example_echo');
>                       
> $layout = new LoggerLayoutTTCC();
> $layout->setContextPrinting(true);
> $layout->setDateFormat('%Y-%m-%d %H:%M:%S');
> $layout->setMicroSecondsPrinting(false);
> $layout->activateOptions();
>                               
> $appender->setLayout($layout);
> $appender->activateOptions();
> $logger->addAppender($appender);
> $logger->info('Test Logger');
> Output:
> 2012-02-20 17:19:56 [3456] INFO example_echo - Test Logger
> Mon Feb 20 17:19:56 2012,607 [3456] INFO example_echo - Test Logger
> The logger and appender are created, and work as expected, except that no 
> context information is given when it echos.
> Other set* methods work properly.  Only setContextPrinting does not.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira