logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicko Cadell" <ni...@neoworks.com>
Subject RE: Why each message printed 2 times?
Date Wed, 12 Jul 2006 09:34:22 GMT
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:bonio.lopez@gmx.de] 
> 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;
> 
> 

Mime
View raw message