[logback-user] set outputPatternAsPresentationHeader programatically?

Andrzej Zadorozny andrzej.zadorozny at gmail.com
Wed May 2 22:54:16 CEST 2012


Sounds great.

Thank you very much for such a quick response. :)

CheerZ! :)


On Wed, May 2, 2012 at 2:50 PM, ceki <ceki at qos.ch> wrote:

> On 02.05.2012 22:36, Andrzej Zadorozny wrote:
>
>> Hello.
>>
>> Just letting you know that logback is awesome, and I like it a lot.
>>
>> I have a quick question regarding the new release.
>> Is there a way to set '**outputPatternAsPresentationHea**der' to 'false'
>> programatically?
>>
>
> Sure. Get a hold of the PatternLayoutEncoder referenced by your appender
> (with the getEncoder() method) and invoke its setOutputPatternAsPresentation
> **Header() method with 'false' as parameter.
>
>
>  I get the default pattern output to stdout even before I get my hands on
>> the logger context:
>> ILoggerFactory factory = LoggerFactory.**getILoggerFactory();
>>
>
> The ConsoleAppender created by BasicConfigurator had this problem. It has
> been fixed in the source repository.
>
>
>  So by the time I get to even begin to configure my own layout, the
>> pattern of the default layout is already on the screen (and it's not
>> even the pattern that I'm trying to configure).
>>
>> Also the link on the web page to "one-question survey" appears to be
>> broken.
>>
>
> Thank you for the heads up. It's now corrected.
>
>
>  I would like to suggest to leave that option as 'false' by default, and
>> give the ability for people to turn it on when they need to.
>>
>
> That seems to be the majority opinion.
>
>
>  Otherwise, logback is awesome, and I am looking forward to new features
>> and enhancements.
>>
>
>  Thank you very much. :)
>>
>
> Much appreciated.
>
>  CheerZ! :)
>>
>>
>
> --
> Ceki
> http://twitter.com/#!/ceki
> ______________________________**_________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/**listinfo/logback-user<http://mailman.qos.ch/mailman/listinfo/logback-user>
>



-- 
----------------------------------------------------------
Andrzej Zadorozny (andrzej.zadorozny at gmail.com)
  -=[ www.andrzej.ca ]=-
----------------------------------------------------------
"Some things are true whether you believe in them or not."
                             - Seth (City of Angels)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20120502/f0834fe6/attachment.html>


More information about the Logback-user mailing list