configuring the log4cplus ConversionPattern for different log level

524 Views Asked by At

i would like to configure different pattern for diff level on the same file e.g.

INFO or DEBUG i dont need to show filename or line number

conversionPattern=%d{%m/%d/%y %H:%M:%S} [%t] %-5p %c - %m %n

WARN or FATAL - I need to show filename or line number

ConversionPattern=%d{%m/%d/%y %H:%M:%S} [%t] %-5p %c{2} %%%x%% - %m [%l]%n

how to do it?

1

There are 1 best solutions below

1
On

No current version of log4cplus supports that. You could get similar effect by using two different appenders with log level filters attached.