RE: Log4net throws exception

2006-03-17 Thread Nicko Cadell
16 March 2006 23:28 > To: Log4NET Dev > Subject: Re: Log4net throws exception > > I think I have to agree with Morton. Were this anything other > than a logging tool, I would flame Morton for inadequate test > coverage. > However, the log4net claims that it shouldn&#x

RE: Log4net throws exception

2006-03-17 Thread Rupp, Richard (GE Healthcare)
: Ron Grabowski [mailto:[EMAIL PROTECTED] Sent: Thursday, March 16, 2006 7:03 PM To: Log4NET Dev Subject: RE: Log4net throws exception This is ok: log.Debug("Hello{0}World{1}Today", null, null); The problem is when you give it a malicious format string: log.DebugFormat("Hell

Re: Log4net throws exception

2006-03-16 Thread Morten Andersen
log.DebugFormat("Hello {0}! Where is {1}?", "Morten"); 109 [10] DEBUG WindowsApplication1.Program (null) - Hello {0}! Where is {1}? arg0: Morten LogImpl.cs virtual public void DebugFormat(string format, params object[] args) { if (IsDebugEnabled) {

RE: Log4net throws exception

2006-03-16 Thread Ron Grabowski
ith Option 4 suggested by Cliff Burger > (16-Mar-2006 3:28 > PM)? > > -----Original Message- > From: Ron Grabowski [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 16, 2006 5:37 PM > To: Log4NET Dev > Subject: Re: Log4net throws exce

RE: Log4net throws exception

2006-03-16 Thread Rupp, Richard (GE Healthcare)
. If I need to write a front-end to protect my application from the exception I question why it is not built into the API. From: Matthew Brown [mailto:[EMAIL PROTECTED] Sent: Thursday, March 16, 2006 6:00 PMTo: Log4NET DevSubject: Re: Log4net throws exception As Ron said, I would argue that this

Re: Log4net throws exception

2006-03-16 Thread Matthew Brown
. What is wrong with Option 4 suggested by Cliff Burger (16-Mar-2006 3:28PM)?-Original Message-From: Ron Grabowski [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 16, 2006 5:37 PMTo: Log4NET DevSubject: Re: Log4net throws exception--- Cliff Burger <[EMAIL PROTECTED]> wrote:> "B

RE: Log4net throws exception

2006-03-16 Thread Rupp, Richard (GE Healthcare)
(16-Mar-2006 3:28 PM)? -Original Message- From: Ron Grabowski [mailto:[EMAIL PROTECTED] Sent: Thursday, March 16, 2006 5:37 PM To: Log4NET Dev Subject: Re: Log4net throws exception --- Cliff Burger <[EMAIL PROTECTED]> wrote: > "By fail-stop, we mean that log4net

Re: Log4net throws exception

2006-03-16 Thread Ron Grabowski
--- Cliff Burger <[EMAIL PROTECTED]> wrote: > "By fail-stop, we mean that log4net will not throw unexpected > exceptions at run-time potentially causing your application to crash. The documentation for String.Format says that if the format is invalid or the number indicating an argument to format

Re: Log4net throws exception

2006-03-16 Thread Cliff Burger
I think I have to agree with Morton. Were this anything other than a logging tool, I would flame Morton for inadequate test coverage. However, the log4net claims that it shouldn't throw exceptions, and there shouldn't be any argument here: Per log4net docs, this is a "serious bug". In an Appeal to

Re: Log4net throws exception

2006-03-16 Thread Morten Andersen
My point is that log4net should not throw exceptions what so ever. - Morten Matthew Brown wrote: Not that it matters to your original point, but I think that simple concatenation of strings for the log statement is often a lot faster than using String.Format anyway... On 3/15/06, Morten

Re: Log4net throws exception

2006-03-15 Thread Matthew Brown
Not that it matters to your original point, but I think that simple concatenation of strings for the log statement is often a lot faster than using String.Format anyway...On 3/15/06, Morten Andersen <[EMAIL PROTECTED]> wrote: Hi! log.DebugFormat("Hello {0}! Where is {1}?, "Morten"); I kn

Re: Log4net throws exception

2006-03-15 Thread Morten Andersen
Today debug format looks something like this: void DebugFormat(string input, params object[] args) {     if (IsDebugEnabled)     {        log(string.Format(input, args));     } } Quick solution (but not very smart) :) void DebugFormat(string input, params object[] args) {     if (IsDebugEnab

Re: Log4net throws exception

2006-03-15 Thread Ron Grabowski
Log4net doesn't have its own run-time parsing engine for the *Format methods; it just calls through to String.Format. If the format string and parameters you're generating aren't compatible with String.Format then you'll get unexpected results. For example, this will not include "Morten" in the mes

Log4net throws exception

2006-03-15 Thread Morten Andersen
Hi! log.DebugFormat("Hello {0}! Where is {1}?, "Morten"); I know that I am missing an argument. The problem here is that some of my applications went down because of this. -- Best Regards Morten Andersen Developer Vianett AS | [EMAIL PROTECTED] | Office: +47 69 20 69 74 | Skype: mortander