Re: how often to call XmlConfigurator.Configure

2010-09-03 Thread Yuriy Taraday
You should configure all appenders ad loggers in one config file. You can configure appender for specific loggers (subtree of loggers) by adding section to config. If you still really want to configure each assembly separately, you should use RepositoryAttribute and set different repository for ev

Re: how do I define log file at run time?

2010-07-13 Thread Yuriy Taraday
Hello. var appender = new log4net.Appender.FileAppender(log4net.Layout.PatternLayout.DetailConversionPattern, scanCode+".log"); log4net.Config.BasicConfigurator.Configure(appender); On Tue, Jul 13, 2010 at 10:23 PM, Pareto, Charles wrote: > I figured out how to change the name of the log file u

Re: Forcing a log rollover

2010-07-13 Thread Yuriy Taraday
Hello. You should override AdjustFileBeforeAppend method and add some flag like "RolloverNow" which will be checked at every incoming event. You'll not get immediate backup, but this is

Re: Log4net + ILMerge + RemoteAppender

2010-05-21 Thread Yuriy Taraday
.Net Remoting identifies type by its *full* name with *full* name of containing assembly. So if you use separate dll, remoting happens throw interface "log4net.Appender.RemotingAppender.IRemoteLoggingSink, log4net, version=1.2.10.0, PublicKeyToken=". When you use single-exe thing, your end of r

Re: RollingAppender Date rollover

2010-05-14 Thread Yuriy Taraday
It is intended behaviour. MaxFiles = 10 means that there can not be more than 10 files at one day. On Fri, May 14, 2010 at 4:00 PM, David Gerler wrote: > HI, > >    We have been using an older precompiled log4net.dll. When we use the date > rollover for the rollingAppender it just keeps all files

Re: Cannot get PropertyFilter to work

2010-05-05 Thread Yuriy Taraday
hy this filter isn't returning true. > > -- > Werner > > > > Yuriy Taraday wrote: >> >> As I understand, this filter checks TreadContext properties, not >> LoggingEvent properties. You should try >> log4net.ThreadContext.Properties["ID"] = >> &

Re: Cannot get PropertyFilter to work

2010-05-05 Thread Yuriy Taraday
As I understand, this filter checks TreadContext properties, not LoggingEvent properties. You should try log4net.ThreadContext.Properties["ID"] = "87e18d7e477349ef9713e19c40ea393a"; On Wed, May 5, 2010 at 2:26 PM, ITemplate wrote: > > Hi, > > I have an appender that has 1 PropertyFilter like so:

Re: How to get line number and file name in custom Appender?

2010-05-04 Thread Yuriy Taraday
I was a bit surprised to see that > log4net per default could write out stack information - is the stacktrace > collected at all times? It would seem so... > > -- > Werner > > > > > Yuriy Taraday wrote: >> >> http://logging.apache.org/log4net/release/sdk/

Re: How to get line number and file name in custom Appender?

2010-05-04 Thread Yuriy Taraday
http://logging.apache.org/log4net/release/sdk/log4net.Layout.PatternLayout.html Note about caller location information. The following patterns %type %file %line %method %location %class %C %F %L %l %M all generate caller location information. Location information uses the System.Diagnostics.StackTr

Re: Problem logging exceptions

2010-04-29 Thread Yuriy Taraday
t;Configure" is the only > way to ensure the correct order (init before usage) - isn't it? > > -- > Werner > > > Yuriy Taraday wrote: >> >> When whole application needs logging, it's preferable to use >> XmlConfiguratorAttribute instead of Conf

Re: Problem logging exceptions

2010-04-28 Thread Yuriy Taraday
When whole application needs logging, it's preferable to use XmlConfiguratorAttribute instead of Configure method. Again, it looks cleaner when you put your logging settings to web.config file. To do so, you must add this line to configSections: (may be changing Version/PuplicKeyToken if you u

Re: StaticLogFileName meaning?

2010-04-26 Thread Yuriy Taraday
pr 27, 2010 at 10:13 AM, ITemplate wrote: > > Hm ok but why is one option better than the other? Should I care? > > > Yuriy Taraday wrote: >> >> Hi. >> >> If there's true, you always log to your example.log file, which is >> renamed as part of rol

Re: StaticLogFileName meaning?

2010-04-26 Thread Yuriy Taraday
Hi. If there's true, you always log to your example.log file, which is renamed as part of rollover procedure. If there's false, you always log to example.log.-MM-dd.N (in common case) file and rollover is just creating one more such file. On Mon, Apr 26, 2010 at 5:39 PM, ITemplate wrote: > >