Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 14, 2010 11:00 PM by spradhan
Member
1 Points
2 Posts
Dec 14, 2010 11:00 PM|LINK
I am facing difficulty in restricting file size using Enterprise Library 4.1. I thought that the rollSizeKB property would do it. I have following settings.. but it doesnt seem to work. Please guide me.
<listeners>
add listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.CustomTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" traceOutputOptions="None" filter="All" type="Test.Diagnostics.EventLogTraceListener, Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d632f3558850e31e" name="Event Log Trace Listener" initializeData="" formatter="Text Formatter"/>
add source="Enterprise Library Logging" formatter="Text Formatter" log="Application" machineName="" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="Formatted EventLog TraceListener"/>
add fileName="C:\Documents and Settings\All Users\Application Data\test.Log" footer="*=*=*=*=*=*=*=*=*=*=*=*=*=*=" formatter="Text Formatter" header="HELLO" rollFileExistsBehavior="Increment" rollInterval="None" rollSizeKB="50" timeStampPattern="yyyy-MM-dd" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="Rolling Flat File Trace Listener"/>listeners>
enterprise Library 4.1 logging
spradhan
Member
1 Points
2 Posts
How to restrict log file size using Enterprise Library 4.1
Dec 14, 2010 11:00 PM|LINK
I am facing difficulty in restricting file size using Enterprise Library 4.1. I thought that the rollSizeKB property would do it. I have following settings.. but it doesnt seem to work. Please guide me.
<listeners>
add listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.CustomTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" traceOutputOptions="None" filter="All" type="Test.Diagnostics.EventLogTraceListener, Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d632f3558850e31e" name="Event Log Trace Listener" initializeData="" formatter="Text Formatter"/>
add source="Enterprise Library Logging" formatter="Text Formatter" log="Application" machineName="" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="Formatted EventLog TraceListener"/>
add fileName="C:\Documents and Settings\All Users\Application Data\test.Log" footer="*=*=*=*=*=*=*=*=*=*=*=*=*=*=" formatter="Text Formatter" header="HELLO" rollFileExistsBehavior="Increment" rollInterval="None" rollSizeKB="50" timeStampPattern="yyyy-MM-dd" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="Rolling Flat File Trace Listener"/>listeners>
enterprise Library 4.1 logging