private void LogIfNonAsync <TResult>(DbCommand command, DbCommandInterceptionContext <TResult> interceptionContext) { if (!interceptionContext.IsAsync) { _log.Warn("Non-async command used: " + DbCommandUtils.OneLineText(command)); } }
private void LogIfError <TResult>(DbCommand command, DbCommandInterceptionContext <TResult> interceptionContext) { if (interceptionContext.Exception != null) { _log.Error("Command " + DbCommandUtils.OneLineText(command) + " failed with exception", interceptionContext.Exception); if (interceptionContext.OriginalException != null) { _log.Error("OriginalException", interceptionContext.OriginalException); } } }
public override void LogCommand <TResult>(DbCommand command, DbCommandInterceptionContext <TResult> interceptionContext) { Write(string.Format("Context '{0}' is executing command '{1}'", Context.GetType().Name, DbCommandUtils.OneLineText(command))); }