Create log for umbraco 7.x

//You can specificy the class your are logging
LogHelper.Error(typeof(MyClass), "msg", e);
//Otherwise, you can use this code, that gets type automatically
LogHelper.Error(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "msg", e);


LogHelper.Error(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "msg", ex);
@using Umbraco.Core.Logging;
LogHelper.Info(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "Message"); 
@using Umbraco.Core.Logging;
    LogHelper.Info(this.GetType(), "Message"); 

About Nguyễn Viết Hiền

Passionate, Loyal
This entry was posted in ASP.NET MVC, C#. Bookmark the permalink.

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s