|
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: |
- 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\)
