Skip to content
Advertisement

Tag: rollingfileappender

Log4j2 customize file path with rollingFileAppender (Java)

I am migrating from log4j 1.x to log4j2 in my spring boot application. Being on log4j 1.x I used to define the properties as follows: in my CustomRollingFileAppender I would extend this class with the DailyRollingFileAppender, and would override the setName() method to change my ‘<base.path>’ to the relevant directory name. Migrating to log4j 2.x I no longer have the

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

Advertisement