Hi Niko,
I understand now what is going on. The initialization code is called from 2
processes and appender writes in the same file. Is it possible somehow to
attach to the same appender from other process? Is there some "shared"
log4net appender object, which can be acquired from other process, when one
process already initialized it?
i.e.
If XXX.already_initialized then attach else initialize.

Thank you very much

-----Original Message-----
From: Nicko Cadell [mailto:[EMAIL PROTECTED] 
Sent: Mittwoch, 12. Juli 2006 10:34
To: Log4NET User
Subject: RE: Why each message printed 2 times?

This is usually caused by having 2 appenders writing to the same output.
These could be both attached to the same logger or to different loggers
(i.e. a logger and the root logger).

Can you post your complete configuration code (looks like you are doing it
in code rather than via an xml file). Or a simplified version of your code
that demonstrates this (just the config code and a single log call would
do). Are you calling your config code only once or multiple times?

Have you enabled log4net's internal debugging?
http://logging.apache.org/log4net/release/faq.html#internalDebug

Also standard questions: log4net version, .net runtime version, application
type (ASP.NET/EXE)

Cheers,
Nicko

> -----Original Message-----
> From: Bonio Lopez [mailto:[EMAIL PROTECTED]
> Sent: 11 July 2006 17:51
> To: 'Log4NET User'
> Subject: Why each message printed 2 times?
> 
> Dear all,
> With minimal lock each message is printed into a log file 2 times. 
> i.e.
> [11 Jul 2006 18:43:10,663] DEBUG Log1  - pi is nothing
> [11 Jul 2006 18:43:10,663] DEBUG Log1  - pi is nothing With exclusive 
> lock works as expected.
> Any ideas why?
> 
> 
> 
> m_LockingModel = new FileAppender.MinimalLock(); m_FileAppender = new 
> FileAppender(); m_FileAppender.Layout = new 
> log4net.Layout.PatternLayout("[%date{dd MMM yyyy HH:mm:ss,fff}] %level 
> %logger  - %message%newline"); m_FileAppender.File = path_to_log + 
> @"\" + m_logger_file_name; m_FileAppender.LockingModel = 
> m_LockingModel; m_FileAppender.ImmediateFlush = true; 
> m_FileAppender.AppendToFile = true;
> 
> 

Reply via email to