|
Everyone, I have an application that runs from a Web Interface as well
as from a command line state. The problem I am having is that when the
batch job runs, that it truncates any data that is in the log file that the web
has been writing to. I want the output from both places to be kept in a
single log file. My log4j configuration looks like the following: log4j.logger.batch.notifyAgents=INFO, notifyAgents log4j.additivity.batch.notifyAgents=false log4j.appender.notifyAgents=org.apache.log4j.DailyRollingFileAppender log4j.appender.notifyAgents.File/logs/notifyAgents.log log4j.appender.notifyAgents.Threshold=INFO log4j.appender.notifyAgents.DatePattern='.'yyyy-MM-dd log4j.appender.notifyAgents.append=true log4j.appender.notifyAgents.layout=org.apache.log4j.PatternLayout log4j.appender.notifyAgents.layout.ConversionPattern=%d [%t] %-5p %c :: %m%n And in the
java code, I call the following to load the file from a packaged jar file: Properties props = new Properties(); URL log4jURL = Thread.currentThread().getContextClassLoader().getResource(log4JFile
); props.load( log4jURL.openStream() ); PropertyConfigurator.configure(props); Are there any properties that can be set to allow the batch
job to run and write to the file (if it already exists), rather than truncate
whats there and then write the data? Any help is greatly
appreciated. Thanks. Daniel |
- Two Loggers - overwriting files Kalcevich, Daniel
- Re: Two Loggers - overwriting files Andreas Fester
- RE: Two Loggers - overwriting files Kalcevich, Daniel
