1
votes

Quiet new newbie to sitecore, I have been reading a lots of blog post from John West regarding sitecore logging and exception handling.

From what I read from sitecore documentation, the exception handling and logging is provided out of box. However, I can lots of people writing blog on including pipeline etc for exception handling and logging.

Could someone please clarify, whether when and why we need to write pipeline for Sitecore using MVC?

1

1 Answers

3
votes

Sitecore has its own built-in logging (Sitecore.Diagnostics namespace) that it uses itself, however you can also write to the Sitecore logs in your own components. So if you develop some front-end site layouts and modules (user controls or web controls), you can also write to the Sitecore log, e.g.

protected void Page_Load(object sender, EventArgs e)
{
  try
  {
    // do your stuff, like loading content...
  }
  catch(Exception ex)
  {
    Sitecore.Diagnostics.Log.Error("Error in ComponentX", ex, this);
  }
}