The .NET Version of chromelogger. Add output to the Chrome console from your .NET application's server-side code.
Install with NuGet: https://nuget.org/packages/ChromeLogger.AspNet/
At the end of your request, you'll need to set the custom ChromeLogger header, here's an example:
public class WebApiApplication : HttpApplication
{
protected void Application_EndRequest(Object sender, EventArgs e)
{
Context.Response.Headers.Add(Logger.GetHeader());
}
}
Install with NuGet: https://nuget.org/packages/ChromeLogger.AspNetCore/
In your Startup
class add a using ChromeLogger;
line. Then in the ConfigureServices
method, add a call to services.AddChromeLogger();
. Finally in the very first line of the Configure
method, add a call to app.UseChromeLogger();
. It is probably a good idea to only make this call in a non-production environment.
Ignore Log calls with null parameter.
Refactoring project to new project format. Add ASP.NET Core support (2.2.2 and higher)
The most notable change is the requirement to manually add the header at the end of the request
Improved the API a bit by adding a dependency on System.Web so calls such as
Logger.Log()
will add the header directly to the response.
A very crude implementation. Largely untested, please file any bugs or issues on the GitHub issues page. I'm open to any and all suggestions to make this work better, please share your thoughts as issues.