Skip to content
Advertisement

Tag: log4j

log4j configurations with daily rolling, gzip and max backup files

Is there an appender that I can use that will get me daily rolling, compression and max files? I can get daily rolling file with compression using apache-log4j-extras with this configuration: But I can’t specify MaxBackupIndex as in org.apache.log4j.RollingFileAppender (note the slight namespace difference between the two). I would like both without having to implement my own FileAppender, TriggeringPolicy, or

Wildcard pattern for RoutingAppender of Log4j2

I am trying to use the new RoutingAppender of Log4j2 to route the different logs based on the MDC (ThreadContext in Log4j2). What I want to do is the following: If MDC map has $contextId -> Append to $contextId appender (specific log) If MDC does not have $contextId -> Append to main appender (general log) I want to achieve this

Advertisement