Re: Problem using a ConsoleAppender in a Windows Form application

2009-06-30 Thread Michael SALOMON
gt; BasicConfigurator.Configure(appender); > > ILog log = LogManager.GetLogger(typeof(Form1)); > log.Debug("Hello World"); > } > } > > ---------- > *From:* Michael SALOMON > *To:* Log4NET User > *Sent:* Friday,

Re: Problem using a ConsoleAppender in a Windows Form application

2009-06-26 Thread Ron Grabowski
); ILog log = LogManager.GetLogger(typeof(Form1)); log.Debug("Hello World"); } } From: Michael SALOMON To: Log4NET User Sent: Friday, June 26, 2009 1:18:49 PM Subject: Re: Problem using a ConsoleAppender in a Windows Form applicat

Re: Problem using a ConsoleAppender in a Windows Form application

2009-06-26 Thread Ron Grabowski
ColoredConsoleAppender calls Console.OpenStandardOutput() in ActivateOptions to store a Stream that represents the console. When you create a console in a WinForm app you need to call ActivateOptions again so the internal Stream can be re-initialized: public partial class Form1 : Form { [Dl

Re: Problem using a ConsoleAppender in a Windows Form application

2009-06-26 Thread Michael SALOMON
Well, I tried this and it still does not work: if (AllocConsole()) AttachConsole(-1); // this file exists XmlConfigurator.ConfigureAndWatch(new System.IO.FileInfo("./Log4Net.config")); LogManager.GetLogger("DebugLogger").Debug("

Re: Problem using a ConsoleAppender in a Windows Form application

2009-06-26 Thread Michael SALOMON
thx for your answer ! i'll try that but then I need to change my approach. Originally I wanted to attach a console depending on log4net config, so now i will try to detach the console depending on the config ;) I don't mind doing that I'll let you know if it works. 2009/6/26 Radovan Raszka >

RE: Problem using a ConsoleAppender in a Windows Form application

2009-06-26 Thread Radovan Raszka
Hello, try to allocate your console _before_ log4net is configured. Radovan Od: Michael SALOMON [mailto:michaelsalomo...@gmail.com] Odesláno: 26. června 2009 15:22 Komu: log4net-user@logging.apache.org Předmět: Problem using a ConsoleAppender in a Windows Form app