BugReport: WarnFormat logging at incorrect level

Vote:
 

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
#254146
Edited, Apr 30, 2021 18:17
Vote:
 

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

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

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.

#254776
May 13, 2021 17:44
Vote:
 

Hi Stefan,

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

#254780
May 13, 2021 18:35
Vote:
 

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

#264878
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.