How to write to the Sitecore log

Sitecore uses log4net for logging. If you want to write to the log in your own code just use the following.

Sitecore.Diagnostics.Log.Error("Error message", exception);
Posted on by Joe in ASP.NET, C#, Sitecore

2 Responses to How to write to the Sitecore log

  1. Clem

    Can you provide some additional info like where the log file is created?

  2. Joe

    It’s the Sitecore log, so inside the logs folder in the Sitecore data folder

Add a Comment