public static void cInfo(this ILog logger, string msg, string label, Exception ex) { log4net.ThreadContext.Properties["user"] = CovCake.GetCurrentUserEmail().ToUpper();; if (!label.IsNullOrEmpty()) { log4net.ThreadContext.Properties["label"] = label.ToUpper(); } if (ex != null) { logger.Info(msg, ex); } else { logger.Info(msg); } log4net.ThreadContext.Properties.Clear(); //["label"] = label; }
public static string GetCurrentUserEmail() { return((CovCake.GetCurrentUser() != null) ? CovCake.GetCurrentUser().Email : "Anonymous"); }