logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: Help me with dinamically setting up the RollingFileAppender please
Date Mon, 27 Oct 2008 21:15:42 GMT
You probably need to call appender.ActivateOptions() before calling Configure().




________________________________
From: Pavel Bazanov <pavel@bazanov.net>
To: log4net-user@logging.apache.org
Sent: Monday, October 27, 2008 6:16:56 AM
Subject: Help me with dinamically setting up the RollingFileAppender please

 
Hello, 
 I have just downloaded the log4net and I can't use 
the RollingFileAppender. Check my code please:
// 
###################################################################
var appender = new log4net.Appender.RollingFileAppender();
appender.AppendToFile = true;
appender.File = "log.txt";
appender.MaxFileSize = 10000;
appender.MaxSizeRollBackups = 10;
appender.RollingStyle = log4net.Appender.RollingFileAppender.RollingMode.Size;
log4net.Config.BasicConfigurator.Configure(appender);
log.Info("event occurred");
// 
###################################################################
No errors produced, but no log file is created, it just 
looks like nothing happens.
What am I doing wrong?
Thank you in advance.
Mime
View raw message