log4javascript web.config

I use log4net in my ASP.NET MVC sites, and want to start using a similar package in my JavaScript (such as log4javascript) to do logging there. Especially logging of exceptions, but also debug logging if a user reports that something went wrong but it isn't readily reproducable.

I now have these questions about integrating log4javascript with ASP.NET MVC:

1) I want to send log messages to the server using log4javascript's AjaxAppender. Is there a package that will implement the web service that receives log messages and logs them server side?

2) I want to be able to set the level of client side loggers in the server side web.config, just as with log4net. This way I could switch on debug logging when needed without hacking JavaScript code (all JS will be combined and minified on production).

I guess on each page load the server can read the web.config and generate a bit of JavaScript that creates the client side loggers. Is there a package that does this?

Answers


log4javascript author here.

  1. I don't know of a service that does this, but it's pretty trivial to do with a web handler and log4net.

  2. Nothing I know of. I've considered writing an XML configurator for log4javascript but no-one's ever asked.


Need Your Help

ASP.NET MVC 2 - How do I pass a querystring back on response?

c# asp.net-mvc

I need to pass a querystring back on response - so that via means of jQuery I can do something with it.