0

I been using Microsoft’s Enterprise Library for Logging. I want to be able to query the Log table based on the AppDomainName, which is not a problem on executables as they log the AssemblyName as the AppDomainName. However, when it comes to an MVC application, I get an arbitrary name, session id I think in the form such as /LM/W3SVC/2/ROOT/AppNameHere-1-130227215731585214

Does anyone have any direction how I can configure this to be a constant name regardless of the session, ie. “AppNameHere”

Thank you

Grigori Melnik
  • 4,067
  • 2
  • 34
  • 40
extofer
  • 92
  • 1
  • 2
  • 7

1 Answers1

0

The Logging Application Block does not control the AppDomain name, and in ASP.NET running on IIS those are the app domain names.

You could create a custom listener to perhaps strip the extra stuff off the app domain name or configure an arbitrary "app id" to use instead of the app domain name. We've done the latter for SLAB's sinks (that's in the latest EntLib v6 - you can download the source and take a look from here).

For a tutorial on how to build a custom listener, see these hands-on labs.

Grigori Melnik
  • 4,067
  • 2
  • 34
  • 40