Umbraco: Error Handling in umbraco

Umbraco provide a great way to log error in umbraco data base. below is way how to log error in umbraco data base

try
{
  // Your code stuff
}
catch(Exception ee)
{
 // Get current Node id of umbraco
 int currentCuntentNodeId = Convert.ToInt32(Request.QueryString["id"].ToString());

 // Loging error in UmbracoLog table.
 Log.Add(LogTypes.Error, currentCuntentNodeId , "My Site Name " + ee.Message );
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s