Skip to main content

Posts

Showing posts with the label Logger

Logger with UmbracoLog

Umbraco logger is powerful tool and It can be extended to use in your Umbraco application to log anything that you want to do, instead of using another logger to do the task. /// <summary> /// Logger to log Error/Debug/Warning to Umbraco log table /// </summary> public class Logger { public enum LogLevels { DEBUG = 1, WARNING = 2, ERROR = 3, NONE = 100 } public static LogLevels CurrentLevel { get; set; } private static string StrLoggedInUserId; public static void SetStrLoggedInUserId() { if (StrLoggedInUserId == null || StrLoggedInUserId == "NA") { if (HttpContext.Current != null) { HttpCookie cookie = HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName]; if (cookie != null) ...