I'm maintaining a windows service that is written a long time ago and the first author has left the company way before I joint.
I want to reduce the eventlog records by leveling up the severity from Information to Warning. But when I check the setting in app.config, I can't find any field that seems to be able to limit severity to write.
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true"/>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="CompanyName0PBR_Service.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup>
</configSections>
<loggingConfiguration name="" tracingEnabled="true" defaultCategory="General">
<listeners>
<add name="Event Log Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
source="PBRProcessing" formatter="Text Formatter" log="CompanyName0PKPBR_Service" machineName="." traceOutputOptions="None" />
</listeners>
<formatters>
<add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" template="Message: {message}{newline}" name="Text Formatter"/>
</formatters>
<categorySources>
<add switchValue="All" name="General">
<listeners>
<add name="Event Log Listener"/>
</listeners>
</add>
</categorySources>
<specialSources>
<allEvents switchValue="Off" name="All Events"/>
<notProcessed switchValue="Off" name="Unprocessed Category"/>
<errors switchValue="Off" name="Logging Errors & Warnings">
<listeners>
<add name="Event Log Listener"/>
</listeners>
</errors>
</specialSources>
</loggingConfiguration>
And the related topic is surprisingly difficult to find on the internet. Is anyone still using this solution could guide me where to set that up?
It's in
switchValue.The usage is like
<add switchValue="Warning"will log severity >= Warning.