Indeed there are errors that don't really prevent logging and there are
errors that do. So we probably need to return a collection of errors.
But if there are errors them we probably also want to provide info and
debug messages that will help the user diagnose the errors.

The only error that we can really be sure of is if the config file
specified is missing.

Also because the ConfigureAndWatch function can cause a reconfiguration
call to happen asynchronously we need a way to handle the errors
asynchronously. For that we will need an event that is raised with the
result of a configuration.

Nicko

> -----Original Message-----
> From: Ron Grabowski [mailto:[EMAIL PROTECTED] 
> Sent: 07 October 2005 20:34
> To: Log4NET Dev
> Subject: RE: Config.AppSettingsConfigurator
> 
> true/false would be a good start but people would ask what failed:
> 
>  // ???
>  if (log4net.Config.XmlConfigurator.Configure() == false)  {
>   processLog4netConfigError(log4net.Config.ConfigException);
>  }
> 
> What's the right thing to do with a log4net config error? 
> Write the message to System.Diagnostics.Trace? Imagine a 
> log4net node with many appenders. Will Configure() only 
> return true if all properties of all items are set correctly? 
> Sometimes I mistakenly set RollingFileAppender properties on 
> a FileAppender. I usually catch the error a few days later by 
> glancing at the internal debug messages. I want my 
> application to continue logging even thought I mistyped one 
> or two properties.
> 
> --- "Rupp, Richard (GE Healthcare)" <[EMAIL PROTECTED]> wrote:
> 
> > With the current beta we're using (1.2.9), if the document 
> file passed 
> > into the XML configurator is malformed a console appender 
> is created. 
> > There is no indication a problem has occurred. It would be 
> useful to 
> > get a true/false indicator that the Configure() method was 
> successful.
> > 
> > For our purposes having an <AppSettings/> element that 
> contains a key 
> > identifying a "default" appender would be great. Maybe 
> something along 
> > the line of:
> > 
> >   <add key="log4net.default" value="..."/>
> > 
> > where the content of value would be "Console" or "File". The "File"
> > appender would support an additional key identifying the filename.
> > 
> >   <add key="log4net.default.filename" value="..."/>
> > 
> > The default appender would be used if there were problems with the 
> > configuration or the configuration is missing.
> > 
> > Thanks.
> 
> 

Reply via email to