SaaS CMS has officially launched! Learn more now.

BugReport: WarnFormat logging at incorrect level


I found out that a specific version of ILog.WarnFormat does not log at the correct level. This is an odd use case, but I have missed log messages due this bug.
Here's an example code snippet to reproduce:

var logger = EPiServer.Logging.Compatibility.LogManager.GetLogger("Test.Log");
logger.WarnFormat(CultureInfo.InvariantCulture, "This should show at the WARN level: {0}", new [] { "param-1" });

Here is the output I found in my log file with appropriate settings to show INFO level:

2021-04-30 12:59:13,790 [5] INFO Test.Log: This should show at the WARN level: param-1
Edited, Apr 30, 2021 18:17

I will file a bug to cms core team. thanks for bringing this to our attention

May 03, 2021 7:32
Quan Mai - May 03, 2021 7:34
the bug is CMS-19226

Hi Matthew

ILog has been a compatibility wrapper for ILogger for quite some time. As a quick-fix you can try using the ILogger interface directly. It should not have this bug.

May 13, 2021 17:44

Hi Stefan,

I understand. Unfortunately, the code using iLog is not mine. 

May 13, 2021 18:35

The bug is now fixed in latest version of cms 12 ( not yet released)

Oct 11, 2021 9:24
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.