Umbraco: How to Log or store error in umbraco Log Table by c#.

Umbraco provide easy way to log exception in there Log table with additional information.

Namespace : using umbraco.BusinessLogic; and using umbraco.NodeFactory;

Method: Log.Add(LogTypes.Type of Log, int nodeId, string error message)

LogTypes : Type of error you want to store. Actually It means under which category you want to file your error or comment.
General LogType: Copy , Custom , Debug , Error, Login and many more.

Node Id: Id of node for which you are loging the error or comment in Log table.
Ex: Node.GetCurrent().Id

Comment: String text you want to store.

For Instance:
Log.Add(LogTypes.Debug, Node.GetCurrent().Id, string.Format(“It seems that you have not setup your mail server”));
Another Umbraco Article

Page Keyword: Exception Handling in umbraco, Exception in Log table in umbraco, Log table in umbraco, Use of Log table in umbraco, Store error in lag table by c# in umbraco, store or handle exception in umbraco.

Advertisements

2 thoughts on “Umbraco: How to Log or store error in umbraco Log Table by c#.

  1. Pingback: Umbraco: How to Create Custom data type in umbraco using c#. | [Code Destination]

  2. Pingback: Install umbraco manually. | [Code Destination]

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