Ron,
 
Thanks a bunch.  Sorry to even make you have to answer that.   I recall reading about programmatic configuration.  The repository lookup didn't click in my head though.
 
I add the code to my custom LogManager as a static method called
AddDefaultAppender() and it works great.
 
Also thanks for the reply on the Async logger.   I've read the docs several times over the course of several months and my recollection just doesn't seem to be serving me well as I am finally using log4net in a project.  
 
Thanks again,
Rich
 


Ron Grabowski <[EMAIL PROTECTED]> wrote:
Apparently that's not the default behavior for log4net. You could do
something like this to ensure a log4net writes to the Console:

XmlConfigurator.Configure();

if (LogManager.GetRepository().GetAppenders().Length == 0)
{
ConsoleAppender consoleAppender = new ConsoleAppender();
consoleAppender.Layout = new SimpleLayout();
BasicConfigurator.Configure(consoleAppender);
}

--- Richard Collette <[EMAIL PROTECTED]>wrote:

> I thought at one point I had read somewhere, perhaps in the Log4J
> docs, that when the logging file was not present, it would use a
> default logging configuration going to the standard output or
> console.
>
> I have a command line program and when the app.config file for it
> is not present, I don't see any console logging.
>
> Advice?
>
> Thanks,
> Rich
>
>




Tritanka 
Richard P. Collette
Certified Lotus Notes Principal Developer

Reply via email to