[logback-user] conversionRule for the File tag and the fileNamePattern

Marco Sousa marcomsousa at gmail.com
Tue Oct 18 14:06:52 CEST 2011


Hi,

But sift only work with:

AccessEventDiscriminator (Access)
MDCBasedDiscriminator (MDC)
ContextBasedDiscriminator, (context)
JNDIBasedContextDiscriminator (Database)


Don't have one to work with the classic variables(%) / conversionRule / ....



-------------------------------------
Marco Sousa


2011/10/18 ceki <ceki at qos.ch>

> Marco,
>
> Have you looked at SiftingAppender?
>
> Cheers,
> --
> Ceki
>
> On 18.10.2011 11:37, Marco Sousa wrote:
>
>> Hi there.
>>
>> I want to set the filename of the file in the appender dynamic
>> constructed by conversionRule (ClassicConverter).
>> Because the filename is depending the %logger.
>> Converter:
>> if (event.getLoggerName().**contains(NEGOCIO)) {
>> StackTraceElement st= event.getCallerData()[0];
>> filename = st.getClassName();
>> filename = filename.substring(NEGOCIO.**length());
>> int endIndex = filename.indexOf(".");
>> filename = filename.substring(0, endIndex);
>> } else {
>> filename = event.getLoggerName();
>>    int endIndex = filename.indexOf(".");
>>    filename = filename.substring(0, endIndex);
>> }
>> return filename;
>>
>> But the ConversionRule only work for the encoder pattern tag. So how to
>> make it work for file tag and the fileNamePattern tag.
>>
>> I allready try with property but don't work.
>>
>>
>  ------------------------------**-------
>> Marco Sousa
>>
>
> ______________________________**_________________
> 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>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20111018/135747d4/attachment.html>


More information about the Logback-user mailing list