log4net skipping some debug logs

24 Views Asked by At

Summary

In the same method, come debug logs succeed while others are skipped.

Code

...

using (var package = new ExcelPackage(fileInfo))
{
    ... do stuff to package

    // this gets skipped
    logger.DebugFormat("File length before saving: {0}", fileInfo.Length);

    package.Save();  // not async, returns void

    // this goes through as expected
    logger.DebugFormat("File length after saving: {0}", fileInfo.Length);

    ... other stuff

    // this also works
    logger.Debug("foo");

    // but then this doesn't
    logger.Debug("bar");
}

If none of my debug logs made it out alive, it would make more sense. If one of my debug logs made it, but none other, it would be weird, but still make more sense than SOME working and SOME not working... always in the same order, too.

Any ideas?

0

There are 0 best solutions below