java - Log4J dailyrolling appender truncates daily files -
I'm having this strange problem with my log4JAppender.
Im using a daily rolling file adapter and the configuration is the same:
# ------------------- -------------- ------------------------------------ -------------- ---- # Log Config for Web # ------------------------- -------------- ------------------------------------ ------------ Log4j Appenderkaveb = Orgkapacheklog4jkdalirollingfilippender Log4jkappenderkavebkdtptern = 'K'yyyy-MM-Dd'klog' Log4jkappenderkaveb. File = @ LOG_DIR @ / web.log log4j.appender aWeb.layout = org.apache.log4j.PatternLayout log4j.appender.aWeb.layout.ConversionPattern = [% d [% T]% c {2}% (M).% L% X {user_name}% x% - 5p]:% m% n Now, my main log file works just fine, the problem is with daily rolled files which are being made.
In the daily rolling file, there is no complete log, instead it has been cut.
A few observations: 1. The cut is based on D, length, ie vary in different amounts of log data in different files 2. Perhaps, the number of log statements may be similar, ie 20 log The logs have been shortened after statements, or maybe something similar.
I am not sure why this is happening, someone has already faced this issue, if not, then possibly it can be possible solution for this.
Thank you
I do not run into this issue you are faced with DailyRollingFileAppender but i RollingFileAppender combination> Lodge 4 J Extras Taimbsed rolling policy package - it's working fine for us is. No problem with the cut down sample configuration.
# Log4j Extras package define the appender by RollingFileAppender log4j.appender.FILE = org.apache.log4j.rolling.rollingFileAppender # Define RollingPolicy for this Appender # more http: // information on logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/rolling/TimeBasedRollingPolicy.html log4j.appender.FILE.RollingPolicy = org.apache.log4j.rolling.TimeBasedRollingPolicy # the RollingPolicy this file The current log was placed log4j.appender.FILE.RollingPolicy.ActiveFileName = @ LOG_DIR @ / web.log # Define the file name for the rolling policy to define the active file name. This file location contains a pattern that specifies how often the file is running and if the compression should occur or not. Log4j.appender.FILE.RollingPolicy.FileNamePattern = @ LOG_DIR @ / web.% D {yyyy-MM-dd} -00-00.log.gz
Comments
Post a Comment