public void Info() { YmatouLoggingService.InitLogService(); YmatouLoggingService.Debug("{0}", "test log4net debug"); YmatouLoggingService.Info("{0}", "test log4net debug"); YmatouLoggingService.Error("{0}", "test log4net debug"); }
private void Log <TResult>( DbCommand command, DbCommandInterceptionContext <TResult> interceptionContext, string sqlType = null, string desc = null) { if (interceptionContext.Exception != null) { YmatouLoggingService.Error("sql {0},{1}, {2} -> failed with exception {3}", sqlType, desc, command.CommandText.Replace(Environment.NewLine, ""), interceptionContext.Exception); } else { YmatouLoggingService.Info("sql {0} ,{1},{2}", sqlType, desc, command.CommandText.Replace(Environment.NewLine, "")); } }