The configuration section for Logging cannot be found in the confi

  • Thread starter Thread starter Andrew
  • Start date Start date
A

Andrew

Hi all,

I have this error :
Message: "The configuration section for Logging cannot be found in the
configuration source."
Source: "Microsoft.Practices.EnterpriseLibrary.Logging"

I've added in the
Microsoft.Practices.EnterpriseLibrary.Logging.dll
Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.Design.dll
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dl
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.Configuration.Design.dll

What is the meaning of "configuration source" ?
Thanks

regards,
Andrew
 
Hi,


The meaning is that at least a class inside
Microsoft.Practices.EnterpriseLibrary.Logging namespace is expecting a
section in the config file it would use to jold configration settings.
You neeed to check the help or some samples to see how that section is
configured
 
Hi,

Thanks for your reply.

In my app.config file, I have:

<loggingConfiguration defaultCategory="Tracing" tracingEnabled="false" >
<logFilters>
<add
name="Category"

type="Microsoft.Practices.EnterpriseLibrary.Logging.Filters.CategoryFilter,
Microsoft.Practices.EnterpriseLibrary.Logging"
categoryFilterMode="AllowAllExceptDenied">
<categoryFilters />
</add>
<add
name="Priority"

type="Microsoft.Practices.EnterpriseLibrary.Logging.Filters.PriorityFilter,
Microsoft.Practices.EnterpriseLibrary.Logging"
minimumPriority="0"
/>
</logFilters>
<categorySources>
<add
name="Default Category"
switchValue="All">
<listeners>
<add name="Event Log Destination" />
</listeners>
</add>
<add
name="Tracing"
switchValue="All">
<listeners>
<add name="Flat File Destination" />
</listeners>
</add>
</categorySources>
<specialSources>
<errors name="errors" switchValue="All">
<listeners>
<add name="Event Log Destination"/>
</listeners>
</errors>
</specialSources>
<listeners>
<add name="Event Log Destination"
type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener,
Microsoft.Practices.EnterpriseLibrary.Logging"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData,
Microsoft.Practices.EnterpriseLibrary.Logging"
source="Enterprise Library Logging"
formatter="Default Formatter"
/>
<add name="Flat File Destination"
type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener,
Microsoft.Practices.EnterpriseLibrary.Logging"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging"
fileName="C:\Projects\ABC\Output\trace.log"
formatter="Default Formatter"
/>
</listeners>
<formatters>
<add
name="Default Formatter"

type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter,
Microsoft.Practices.EnterpriseLibrary.Logging"
template="Timestamp: {timestamp}
Message: {message}"
/>
</formatters>
</loggingConfiguration>

This should do it right? So why is it still not working ?

regards,
Andrew
 
Back
Top