java - Log4j2 Delete on Rollover is not working as expected, in Pingfederate -
in pingfederate, internally uses log4j2 log events. trying rollover , delete older logs. while rollover functionality works, , log rolled over, deletion functionality doesn't seem work. don't understand ? kindly explain , me fix this.
also, trying log log4j2 itself, reason not getting logged in console logs.
thanks bunch. if need more information, kindly comment.
<?xml version="1.0" encoding="utf-8"?> <configuration status="trace"> <appenders> <console name="console" target="system_out"> <patternlayout> <charset>utf-8</charset> <pattern>%d %p %c{1.} [%t] %m%n</pattern> </patternlayout> </console> <!-- main log : size based file rolling appender --> <rollingfile name="file" filename="${sys:pf.log.dir}/server_${sys:pf.ip}.log" filepattern="${sys:pf.log.dir}/server_${sys:pf.ip}.log.%i" ignoreexceptions="false"> <patternlayout> <charset>utf-8</charset> <pattern>%d %x{trackingid} %-5p [%c] %enc{%m}%n</pattern> </patternlayout> <policies> <sizebasedtriggeringpolicy size="10000 kb" /> </policies> <defaultrolloverstrategy max="5" /> </rollingfile> <!-- security audit log : time/date based rolling appender --> <rollingfile name="securityaudit2file" filename="${sys:pf.log.dir}/audit_${sys:pf.ip}.log" filepattern="${sys:pf.log.dir}/audit_${sys:pf.ip}.%d{yyyy-mm-dd:hh:mm}.log" ignoreexceptions="false"> <patternlayout> <pattern>%d %p %c{1.} [%t] %m%n</pattern> </patternlayout> <policies> <timebasedtriggeringpolicy interval="1"/> </policies> <defaultrolloverstrategy> <delete basepath="${sys:pf.log.dir}" maxdepth="1"> <iffilename glob="audit*.log" /> <iflastmodified age="2m" /> </delete> </defaultrolloverstrategy> </rollingfile> <!-- admin audit log : time/date based rolling appender --> <!-- <rollingfile name="adminaudit" filename="${sys:pf.log.dir}/admin.log" filepattern="${sys:pf.log.dir}/admin.%d{yyyy-mm-dd}.log" ignoreexceptions="false"> <patternlayout> <charset>utf-8</charset> <pattern>%d|%x{user}|%x{roles}|%x{event}|%m%n</pattern> </patternlayout> <policies> <timebasedtriggeringpolicy /> </policies> </rollingfile> --> <!-- admin api audit log : time/date based rolling appender --> <!-- <rollingfile name="adminapiaudit" filename="${sys:pf.log.dir}/admin-api.log" filepattern="${sys:pf.log.dir}/admin-api.%d{yyyy-mm-dd}.log" ignoreexceptions="false"> <patternlayout> <charset>utf-8</charset> <pattern>%d|%x{api.user}|%x{api.authtype}|%x{api.clientip}|%x{api.httpmethod}|%x{api.url}|%x{api.status}%n</pattern> </patternlayout> <policies> <timebasedtriggeringpolicy /> </policies> </rollingfile> --> <!-- runtime api audit log : time/date based rolling appender --> <rollingfile name="runtimeapiaudit" filename="${sys:pf.log.dir}/runtime-api.log" filepattern="${sys:pf.log.dir}/runtime-api.%d{yyyy-mm-dd}.log" ignoreexceptions="false"> <patternlayout> <charset>utf-8</charset> <pattern>%d|%enc{%x{api.user}}|%x{api.authtype}|%x{api.clientip}|%x{api.httpmethod}|%x{api.url}|%x{api.status}%n</pattern> </patternlayout> <policies> <timebasedtriggeringpolicy /> </policies> </rollingfile> </appenders> <loggers> <logger name="httpclient.wire.content" level="warn" /> <!-- adjust priority value debug additional logging troubleshoot xml signature problems --> <logger name="org.sourceid.common.dsig" level="warn" /> <!-- set debug see inbound , outbound protocol messages --> <logger name="org.sourceid.saml20.bindings.logginginterceptor" level="warn"/> <logger name="org.eclipse.jetty" level="warn" /> <logger name="org.eclipse.jetty.io.nio" level="warn" /> <logger name="org.apache.logging.log4j" level="trace"> <appender-ref ref="console" /> </logger> <logger name="org.sourceid.websso.profiles.sp.spauditlogger" level="info" additivity="false"> <appender-ref ref="securityaudit2file" /> </logger> <logger name="org.sourceid.websso.profiles.idp.idpauditlogger" level="info" additivity="false"> <appender-ref ref="securityaudit2file" /> </logger> <logger name="org.sourceid.websso.profiles.idp.asauditlogger" level="info" additivity="false"> <appender-ref ref="securityaudit2file" /> </logger> <logger name="org.sourceid.wstrust.log.stsauditlogger" level="info" additivity="false"> <appender-ref ref="securityaudit2file" /> </logger> <!-- <logger name="auditlogger" level="info" additivity="false"> <appender-ref ref="adminaudit" /> </logger> <logger name="adminapiauditlogger" level="info" additivity="false" includelocation="false"> <appender-ref ref="adminapiaudit" /> </logger> --> <logger name="runtimeapiauditlogger" level="info" additivity="false" includelocation="false"> <appender-ref ref="runtimeapiaudit" /> </logger> <root level="trace"> <appenderref ref="console" /> </root> </loggers> </configuration>
Comments
Post a Comment