Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
remove double logging from the web api layer
Browse files Browse the repository at this point in the history
  • Loading branch information
brockallen committed Jan 15, 2017
1 parent 9b33d32 commit e434539
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 0 additions & 2 deletions source/Core/Configuration/Hosting/ErrorPageFilterAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ internal class ErrorPageFilterAttribute : ExceptionFilterAttribute

public override async System.Threading.Tasks.Task OnExceptionAsync(HttpActionExecutedContext actionExecutedContext, System.Threading.CancellationToken cancellationToken)
{
Logger.ErrorException("Exception accessing: " + actionExecutedContext.Request.RequestUri.AbsolutePath, actionExecutedContext.Exception);

var env = actionExecutedContext.ActionContext.Request.GetOwinEnvironment();
var options = env.ResolveDependency<IdentityServerOptions>();
var viewSvc = env.ResolveDependency<IViewService>();
Expand Down
10 changes: 9 additions & 1 deletion source/Core/Configuration/Hosting/LogProviderExceptionLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ internal class LogProviderExceptionLogger : IExceptionLogger

public async Task LogAsync(ExceptionLoggerContext context, CancellationToken cancellationToken)
{
Logger.ErrorException("Unhandled exception", context.Exception);
if(context.Request != null)
{
var mesage = string.Format("Unhandled exception accessing: {0}", context.Request.RequestUri.AbsolutePath);
Logger.ErrorException(mesage, context.Exception);
}
else
{
Logger.ErrorException("Unhandled exception", context.Exception);
}

var env = context.Request.GetOwinEnvironment();
var events = env.ResolveDependency<IEventService>();
Expand Down

0 comments on commit e434539

Please sign in to comment.