The configuration section for Logging cannot be found in the confi

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
 
I

Ignacio Machin \( .NET/ C# MVP \)

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
 
A

Andrew

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top