Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified src/.nuget/NuGet.exe
Binary file not shown.
42 changes: 36 additions & 6 deletions src/ServiceStack.Logging.Elmah/ElmahInterceptingLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,37 +43,67 @@ public void DebugFormat(string format, params object[] args)

public void Error(object message, Exception exception)
{
ErrorLog.GetDefault(HttpContext.Current).Log(new Error(exception, HttpContext.Current));
try {
ErrorLog.GetDefault(HttpContext.Current).Log(new Error(exception, HttpContext.Current));
}
catch {
ErrorLog.GetDefault(null).Log(new Error(exception));
}
log.Error(message, exception);
}

public void Error(object message)
{
ErrorLog.GetDefault(HttpContext.Current).Log(new Error(new System.ApplicationException(message.ToString()), HttpContext.Current));
try {
ErrorLog.GetDefault(HttpContext.Current).Log(new Error(new System.ApplicationException(message.ToString()), HttpContext.Current));
}
catch {
ErrorLog.GetDefault(null).Log(new Error(new System.ApplicationException(message.ToString())));
}
log.Error(message);
}

public void ErrorFormat(string format, params object[] args)
{
ErrorLog.GetDefault(HttpContext.Current).Log(new Error(new System.ApplicationException(string.Format(format, args)), HttpContext.Current));
try {
ErrorLog.GetDefault(HttpContext.Current).Log(new Error(new System.ApplicationException(string.Format(format, args)), HttpContext.Current));
}
catch {
ErrorLog.GetDefault(null).Log(new Error(new System.ApplicationException(string.Format(format, args))));
}
log.ErrorFormat(format, args);
}

public void Fatal(object message, Exception exception)
{
ErrorLog.GetDefault(HttpContext.Current).Log(new Error(exception, HttpContext.Current));
try {
ErrorLog.GetDefault(HttpContext.Current).Log(new Error(exception, HttpContext.Current));
}
catch {
ErrorLog.GetDefault(null).Log(new Error(exception));
}
log.Fatal(message, exception);
}

public void Fatal(object message)
{
ErrorLog.GetDefault(HttpContext.Current).Log(new Error(new System.ApplicationException(message.ToString()), HttpContext.Current));
try {
ErrorLog.GetDefault(HttpContext.Current).Log(new Error(new System.ApplicationException(message.ToString()), HttpContext.Current));
}
catch {
ErrorLog.GetDefault(null).Log(new Error(new System.ApplicationException(message.ToString())));
}
log.Fatal(message);
}

public void FatalFormat(string format, params object[] args)
{
ErrorLog.GetDefault(HttpContext.Current).Log(new Error(new System.ApplicationException(string.Format(format, args)), HttpContext.Current));
try {
ErrorLog.GetDefault(HttpContext.Current).Log(new Error(new System.ApplicationException(string.Format(format, args)), HttpContext.Current));
}
catch {
ErrorLog.GetDefault(null).Log(new Error(new System.ApplicationException(string.Format(format, args))));
}
log.FatalFormat(format, args);
}

Expand Down