I noticed that there are two ways to write magazines in Umbraco. One way is to use the LogHelper class, and the other is to directly use the methods of the instance obtained using the log4net.LogManager.GetLogger method. Needless to say, LogHelper also uses log4net.
I added a custom logging application, setting the appender file to a different file from the default, and tried in both directions, and noticed that the results in the log are more or less the same. The LogHelper entry is as follows:
ERROR ProjectName.Controllers.Backoffice.DataController - [P4876 / T1 / D2] Test
while the entry that log4net creates looks like this:
ERROR ProjectName.Controllers.Backoffice.DataController - Test
However, when I looked for registration messages in Umbraco, I often found examples of using log4net directly, instead of using the LogHelper class provided by Umbraco CMS.
Basically, are there any good reasons why developers should use one path instead of another, or just a matter of preference for using library methods instead of using the helper class provided by CMS (or vice versa (helper in front of the library)?
source share