Campbell Ritchie wrote:Where does RollingFileAppender come from?
Puspender Tanwar wrote:Even I have used RollingFileAppender, the file is not rolling up and logging is written into single file.
Now if I remove the dbLogger appender, then the Rolling of file get succeed. Means, if multiple appenders are writing to same file, the RollingFileAppender stops behaving correctly.
Is there any workaround to this ?
Paul Clapham wrote:Your description is perfectly clear (we don't often get clear problem descriptions here). And if you read it over, you'll see it contains a description of the solution.
You wrote:Now if I remove the dbLogger appender, then the Rolling of file get succeed.
Puspender Tanwar wrote:I am using log4j where I need to create logging for multiple appenders into a single file.
what is the case with UNIX or LINUX?
Paul Clapham wrote:If you're using Windows and you have two separate appenders trying to write to the same file, then probably one appender can't close and rename the file because the other appender still has a lock on it
Even if the OS allows two writers to write to the same file, in that case the rolling feature doesn't work.
Tim Holloway wrote:define a single destination and target both your org.hibernate and regular logging sources to it.
Paul Clapham wrote:Perhaps it would help if you mentioned why you need more than one appender for the file?
I tried this one as well. When I used only one appender, the second value of appender overrides the first one. So org.hibernate get overridden by com.bcone.oracle.ebs and only com.bcone.oracle.ebs logging gets logged in the file.
Paul Clapham wrote: So why not have only one appender and allow both loggers to use it?
Paul Clapham wrote:And if you think that overriding is taking place, then try this:
root logger also stopped Rolling when different projects started logging. If single project logs into the file, Rolling works.
Paul Clapham wrote:But if you only need one appender, why not just use the root logger like in almost every example of log4j configuration file which you can find on the web?
Paul Clapham wrote:Sanity check: these two things, EBS and Hibernate, they are running in the same class loader, right? If they were running in different class loaders then they would each run their own copy of log4j, essentially making them different applications trying to do simultaneous access to the log file.
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your databasehttps://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database