Skip to content
This repository has been archived by the owner on Oct 15, 2019. It is now read-only.

Commit

Permalink
Merge pull request #12 from SkillsFundingAgency/CI-282_logging_requests
Browse files Browse the repository at this point in the history
CI-282 logging roatp register requests
  • Loading branch information
scottcowan authored May 23, 2017
2 parents f1f3db2 + 0ee937a commit 4d8ece7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Sfa.Roatp.Register.Web/Global.asax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ namespace Sfa.Roatp.Registry.Web
{
public class Global : HttpApplication
{
private ILog _logger;

public Global()
{
_logger = DependencyResolver.Current.GetService<ILog>();
}

void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
Expand All @@ -29,6 +36,14 @@ protected void Application_BeginRequest(object sender, EventArgs e)
{
var application = sender as HttpApplication;
application?.Context?.Response.Headers.Remove("Server");

_logger = DependencyResolver.Current.GetService<ILog>();

HttpContext context = base.Context;
if (!context.Request.Path.StartsWith("/__browserlink"))
{
_logger.Info($"{context.Request.HttpMethod} {context.Request.Path}");
}
}

protected void Application_Error(object sender, EventArgs e)
Expand Down

0 comments on commit 4d8ece7

Please sign in to comment.