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 (IsDebugEnabled) { try { log(string.Format(input, args)); } catch { } } } Best Regards Ron Grabowski wrote: 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 message:log.DebugFormat("Hello! Where is?, "Morten"); If you think that DebugFormat will cause problems, I recommend using just the normal Debug method. Perhaps the documentation could be improved to highlight this. --- Morten Andersen <[EMAIL PROTECTED]> wrote: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 <http://www.vianett.no/> | [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> | Office: +47 69 20 69 74 <callto://+4769206974> | Skype: mortander <callto://mortander> |
- Log4net throws exception Morten Andersen
- Re: Log4net throws exception Ron Grabowski
- Re: Log4net throws exception Morten Andersen
- Re: Log4net throws exception Matthew Brown
- Re: Log4net throws exception Morten Andersen
- Re: Log4net throws exception Cliff Burger
- Re: Log4net throws except... Ron Grabowski
- RE: Log4net throws exception Rupp, Richard \(GE Healthcare\)
- Re: Log4net throws exception Matthew Brown
- RE: Log4net throws exception Rupp, Richard \(GE Healthcare\)
- RE: Log4net throws exception Ron Grabowski
- Re: Log4net throws exception Morten Andersen
- RE: Log4net throws exception Rupp, Richard \(GE Healthcare\)