title: What is the best practice for logging in Umbraco?
body: <p>I noticed there are at least two ways to write logs in Umbraco. One way is using the <code>LogHelper</code> class, and the other is to use directly the methods of the instance obtained with <code>log4net.LogManager.GetLogger</code> method. Needless to say that LogHelper uses log4net itself, too.</p>
  
  <p>I added a custom log appender, set the file destination of the appender to be the custom file (different than the default one) and tried both ways, and noticed that the results in log are more or less the same. LogHelper's entry looks like this:</p>
  
  <blockquote>
    <p>ERROR ProjectName.Controllers.Backoffice.DataController - [P4876/T1/D2] Test</p>
  </blockquote>
  
  <p>while the entry that log4net makes looks like this:</p>
  
  <blockquote>
    <p>ERROR ProjectName.Controllers.Backoffice.DataController - Test</p>
  </blockquote>
  
  <p>However, when I searched for posts about logging on Umbraco, I often found examples of using log4net directly, rather than using the LogHelper class provided by Umbraco CMS.</p>
  
  <p>So basically, are there any good reasons developers should use one way instead of the other, or is it simply the matter of preference of using methods of the library instead of using CMS-provided helper class (or the other way around - helper before the library)?</p>