Help me find a solution to register minimal friction for asp.net applications

Let's say, for the sake of argument, that I have 30 asp.net web applications (and blerg sites) that should have a logging structure. My current solution is to use Enterprise Library Magazine. How does this happen on the site, follow these steps:

  • add links to two assemblies (EL Logging and Common)
  • add code to Global.asax.cs for general raw error capture
  • copy to enterpriseLibrary.config, copy from another application that already has logging
  • copy to FileConfigurationSource.cs (which allows you to override the requirement for a hard-coded path to enterpriseLibrary.config)
  • change the namespace in FileConfigurationSource.cs to a new project
  • copy the web.config sections from another project that are related to EL (2 sections)
  • change namespaces in web.config for EL in a new project
  • and make sure it works (usually without using the database offline)

All this friction that I'm talking about. These are many DRY violations if you ask me, especially in all enterpriseLibrary.config settings. Ideally, adding logging would be a two-step process - this will help me get it on the team.

I wonder if there is a logging solution for .net that does not have all of these repetitions ? All of them that I can find (log4net, nlog, EL Logging) seem to use this "every application has its own configuration with a lot of repetitions." Maybe I missed something.

, 99% . , . , ? , .

: ( web.config, ), ( , -). web.config , .config , web.config, .

+3
1

, .

, - ASP.NET - SharePoint , , , .. .

NLog, .

, NLog config, :

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      autoReload="true">
  <include file="PATH TO THE SHARED CONFIG" /> <!-- change this line -->
</nlog>

- NLog :

  • - web.config
  • web.nlog, , web.config
  • NLog.config
  • NLog.dll.nlog , NLog.dll

, ASP.NET- , autoReload="true", . targets , , ..

+1

All Articles