EntLib Configuration Conflict

Topics: Enterprise Library Core, Logging Application Block
Jul 23, 2009 at 11:57 PM

I have a website with several virtual directories that are all configured as IIS applications. So, I have one top-level web.config and a web.config in each virtual directory.

I am trying to configure all these web applications to use logging application block. The problem is that there seems to be a conflict. The top-level application works fine, but all lower level apps complain about duplicate configuration entries (see example below). I cannot use all unique names in each config file - there is at least one value that is common, a category name.

Any help is appreciated!

Parser Error Message: The entry 'Text Formatter' has already been added.

Source Error:

Line 30:     </listeners>
Line 31:     <formatters>
Line 32:       <add template="Timestamp: {timestamp}&#xD;&#xA;Message: {message}&#xD;&#xA;Category: {category}&#xD;&#xA;Priority: {priority}&#xD;&#xA;EventId: {eventid}&#xD;&#xA;Severity: {severity}&#xD;&#xA;Title:{title}&#xD;&#xA;Machine: {machine}&#xD;&#xA;Application Domain: {appDomain}&#xD;&#xA;Process Id: {processId}&#xD;&#xA;Process Name: {processName}&#xD;&#xA;Win32 Thread Id: {win32ThreadId}&#xD;&#xA;Thread Name: {threadName}&#xD;&#xA;Extended Properties: {dictionary({key} - {value}&#xD;&#xA;)}"
Line 33:         type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Line 34:         name="Text Formatter" />
Jul 24, 2009 at 9:40 AM

I'm not that familiar with this kind of scenario, I was just thinking, does the other lower level configs inherited from the top level config? Are you doing a Configuration delagation? What IIS are you using?

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jul 29, 2009 at 9:51 AM
Edited Jul 29, 2009 at 10:19 AM

I'm guessing it is configuration inheritance.  The following will help:

http://www.keithelder.net/blog/archive/2007/05/15/Enterprise-Library-Error--The-entry-ExceptionPolicy-has-already-been.aspx

http://forums.iis.net/p/994377/1297968.aspx#1297968

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com