blob: fc96f251ff006c904640988c910842782c9f8650 [file] [log] [blame]
<html><head><meta http-equiv="X-UA-Compatible" content="IE=edge" /><link rel="shortcut icon" href="../icons/favicon.ico" /><style type="text/css">.OH_CodeSnippetContainerTabLeftActive, .OH_CodeSnippetContainerTabLeft,.OH_CodeSnippetContainerTabLeftDisabled { }.OH_CodeSnippetContainerTabRightActive, .OH_CodeSnippetContainerTabRight,.OH_CodeSnippetContainerTabRightDisabled { }.OH_footer { }</style><link rel="stylesheet" type="text/css" href="../styles/branding.css" /><link rel="stylesheet" type="text/css" href="../styles/branding-en-US.css" /><script type="text/javascript" src="../scripts/branding.js"> </script><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>RollingFileAppender Class</title><meta name="Language" content="en-us" /><meta name="System.Keywords" content="RollingFileAppender class" /><meta name="System.Keywords" content="log4net.Appender.RollingFileAppender class" /><meta name="System.Keywords" content="RollingFileAppender class, about RollingFileAppender class" /><meta name="Microsoft.Help.F1" content="log4net.Appender.RollingFileAppender" /><meta name="Microsoft.Help.Id" content="T:log4net.Appender.RollingFileAppender" /><meta name="Description" content="Appender that rolls log files based on size or date or both." /><meta name="Microsoft.Help.ContentType" content="Reference" /><meta name="BrandingAware" content="true" /><meta name="container" content="log4net.Appender" /><meta name="file" content="T_log4net_Appender_RollingFileAppender" /><meta name="guid" content="T_log4net_Appender_RollingFileAppender" /></head><body onload="OnLoad('cs')"><input type="hidden" id="userDataCache" class="userDataStyle" /><div class="OH_outerDiv"><div class="OH_outerContent"><table class="TitleTable"><tr><td class="OH_tdTitleColumn">RollingFileAppender Class</td><td class="OH_tdRunningTitleColumn">Apache log4net™ SDK Documentation</td></tr></table><div id="mainSection"><div id="mainBody"><span class="introStyle"></span><div class="summary">
Appender that rolls log files based on size or date or both.
</div><div class="OH_CollapsibleAreaRegion"><div class="OH_regiontitle">Inheritance Hierarchy</div><div class="OH_CollapsibleArea_HrDiv"><hr class="OH_CollapsibleArea_Hr" /></div></div><div class="OH_clear"> </div><a href="http://msdn2.microsoft.com/en-us/library/e5kfa45b" target="_blank">System<span id="LSTBB37F8A8_0"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_0?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>Object</a><br />  <a href="T_log4net_Appender_AppenderSkeleton.htm">log4net.Appender<span id="LSTBB37F8A8_1"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_1?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>AppenderSkeleton</a><br />    <a href="T_log4net_Appender_TextWriterAppender.htm">log4net.Appender<span id="LSTBB37F8A8_2"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_2?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>TextWriterAppender</a><br />      <a href="T_log4net_Appender_FileAppender.htm">log4net.Appender<span id="LSTBB37F8A8_3"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_3?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>FileAppender</a><br />        <span class="selflink">log4net.Appender<span id="LSTBB37F8A8_4"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_4?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>RollingFileAppender</span><br /><p> </p><strong>Namespace:</strong> <a href="N_log4net_Appender.htm">log4net.Appender</a><br /><strong>Assembly:</strong> log4net (in log4net.dll) Version: 2.0.8.0-.NET 4.0<div class="OH_CollapsibleAreaRegion"><div class="OH_regiontitle">Syntax</div><div class="OH_CollapsibleArea_HrDiv"><hr class="OH_CollapsibleArea_Hr" /></div></div><div class="OH_clear"> </div><div class="OH_CodeSnippetContainer"><div class="OH_CodeSnippetContainerTabs"><div class="OH_CodeSnippetContainerTabLeft" id="ID0EDCA_tabimgleft"> </div><div id="ID0EDCA_tab1" class="OH_CodeSnippetContainerTabFirst"><a href="#" onclick="javascript:ChangeTab('ID0EDCA','cs','1','4');return false;">C#</a></div><div id="ID0EDCA_tab2" class="OH_CodeSnippetContainerTab"><a href="#" onclick="javascript:ChangeTab('ID0EDCA','vb','2','4');return false;">VB</a></div><div id="ID0EDCA_tab3" class="OH_CodeSnippetContainerTab"><a href="#" onclick="javascript:ChangeTab('ID0EDCA','cpp','3','4');return false;">C++</a></div><div id="ID0EDCA_tab4" class="OH_CodeSnippetContainerTab"><a href="#" onclick="javascript:ChangeTab('ID0EDCA','fs','4','4');return false;">F#</a></div><div class="OH_CodeSnippetContainerTabRight" id="ID0EDCA_tabimgright"> </div></div><div class="OH_CodeSnippetContainerCodeCollection"><div class="OH_CodeSnippetToolBar"><div class="OH_CodeSnippetToolBarText"><a id="ID0EDCA_copyCode" href="#" onclick="javascript:CopyToClipboard('ID0EDCA');return false;" title="Copy">Copy</a></div></div><div id="ID0EDCA_code_Div1" class="OH_CodeSnippetContainerCode" style="display: block"><pre xml:space="preserve"><span class="keyword">public</span> <span class="keyword">class</span> <span class="identifier">RollingFileAppender</span> : <span class="identifier">FileAppender</span></pre></div><div id="ID0EDCA_code_Div2" class="OH_CodeSnippetContainerCode" style="display: none"><pre xml:space="preserve"><span class="keyword">Public</span> <span class="keyword">Class</span> <span class="identifier">RollingFileAppender</span>
<span class="keyword">Inherits</span> <span class="identifier">FileAppender</span></pre></div><div id="ID0EDCA_code_Div3" class="OH_CodeSnippetContainerCode" style="display: none"><pre xml:space="preserve"><span class="keyword">public</span> <span class="keyword">ref class</span> <span class="identifier">RollingFileAppender</span> : <span class="keyword">public</span> <span class="identifier">FileAppender</span></pre></div><div id="ID0EDCA_code_Div4" class="OH_CodeSnippetContainerCode" style="display: none"><pre xml:space="preserve"><span class="keyword">type</span> <span class="identifier">RollingFileAppender</span> =
<span class="keyword">class</span>
<span class="keyword">inherit</span> <span class="identifier">FileAppender</span>
<span class="keyword">end</span></pre></div></div></div><script type="text/javascript">AddLanguageTabSet("ID0EDCA");</script><p>The <span class="selflink">RollingFileAppender</span> type exposes the following members.</p><div class="OH_CollapsibleAreaRegion"><div class="OH_regiontitle">Constructors</div><div class="OH_CollapsibleArea_HrDiv"><hr class="OH_CollapsibleArea_Hr" /></div></div><div class="OH_clear"> </div><table id="memberList" class="members"><tr><th class="ps_iconColumn">
 
</th><th>Name</th><th>Description</th></tr><tr data="public;declared;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="M_log4net_Appender_RollingFileAppender__ctor.htm">RollingFileAppender</a></td><td><div class="summary">
Initializes a new instance of the <span class="selflink">RollingFileAppender</span> class.
</div></td></tr></table><a href="#mainBody">Top</a><div class="OH_CollapsibleAreaRegion"><div class="OH_regiontitle">Properties</div><div class="OH_CollapsibleArea_HrDiv"><hr class="OH_CollapsibleArea_Hr" /></div></div><div class="OH_clear"> </div><table id="memberList" class="members"><tr><th class="ps_iconColumn">
 
</th><th>Name</th><th>Description</th></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_FileAppender_AppendToFile.htm">AppendToFile</a></td><td><div class="summary">
Gets or sets a flag that indicates whether the file should be
appended to or overwritten.
</div> (Inherited from <a href="T_log4net_Appender_FileAppender.htm">FileAppender</a>.)</td></tr><tr data="public;declared;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_RollingFileAppender_CountDirection.htm">CountDirection</a></td><td><div class="summary">
Gets or sets the rolling file count direction.
</div></td></tr><tr data="public;declared;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_RollingFileAppender_DatePattern.htm">DatePattern</a></td><td><div class="summary">
Gets or sets the date pattern to be used for generating file names
when rolling over on date.
</div></td></tr><tr data="public;declared;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_RollingFileAppender_DateTimeStrategy.htm">DateTimeStrategy</a></td><td><div class="summary">
Gets or sets the strategy for determining the current date and time. The default
implementation is to use LocalDateTime which internally calls through to DateTime.Now.
DateTime.UtcNow may be used on frameworks newer than .NET 1.0 by specifying
<span class="nolink">UniversalDateTime</span>.
</div></td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_FileAppender_Encoding.htm">Encoding</a></td><td><div class="summary">
Gets or sets <a href="P_log4net_Appender_FileAppender_Encoding.htm">Encoding</a> used to write to the file.
</div> (Inherited from <a href="T_log4net_Appender_FileAppender.htm">FileAppender</a>.)</td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_TextWriterAppender_ErrorHandler.htm">ErrorHandler</a></td><td><div class="summary">
Gets or set the <a href="T_log4net_Core_IErrorHandler.htm">IErrorHandler</a> and the underlying
<a href="T_log4net_Util_QuietTextWriter.htm">QuietTextWriter</a>, if any, for this appender.
</div> (Inherited from <a href="T_log4net_Appender_TextWriterAppender.htm">TextWriterAppender</a>.)</td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_FileAppender_File.htm">File</a></td><td><div class="summary">
Gets or sets the path to the file that logging will be written to.
</div> (Inherited from <a href="T_log4net_Appender_FileAppender.htm">FileAppender</a>.)</td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_AppenderSkeleton_FilterHead.htm">FilterHead</a></td><td><div class="summary">
The filter chain.
</div> (Inherited from <a href="T_log4net_Appender_AppenderSkeleton.htm">AppenderSkeleton</a>.)</td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_TextWriterAppender_ImmediateFlush.htm">ImmediateFlush</a></td><td><div class="summary">
Gets or set whether the appender will flush at the end
of each append operation.
</div> (Inherited from <a href="T_log4net_Appender_TextWriterAppender.htm">TextWriterAppender</a>.)</td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_AppenderSkeleton_Layout.htm">Layout</a></td><td><div class="summary">
Gets or sets the <a href="T_log4net_Layout_ILayout.htm">ILayout</a> for this appender.
</div> (Inherited from <a href="T_log4net_Appender_AppenderSkeleton.htm">AppenderSkeleton</a>.)</td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_FileAppender_LockingModel.htm">LockingModel</a></td><td><div class="summary">
Gets or sets the <a href="P_log4net_Appender_FileAppender_LockingModel.htm">LockingModel</a> used to handle locking of the file.
</div> (Inherited from <a href="T_log4net_Appender_FileAppender.htm">FileAppender</a>.)</td></tr><tr data="public;declared;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_RollingFileAppender_MaxFileSize.htm">MaxFileSize</a></td><td><div class="summary">
Gets or sets the maximum size that the output file is allowed to reach
before being rolled over to backup files.
</div></td></tr><tr data="public;declared;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_RollingFileAppender_MaximumFileSize.htm">MaximumFileSize</a></td><td><div class="summary">
Gets or sets the maximum size that the output file is allowed to reach
before being rolled over to backup files.
</div></td></tr><tr data="public;declared;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_RollingFileAppender_MaxSizeRollBackups.htm">MaxSizeRollBackups</a></td><td><div class="summary">
Gets or sets the maximum number of backup files that are kept before
the oldest is erased.
</div></td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_AppenderSkeleton_Name.htm">Name</a></td><td><div class="summary">
Gets or sets the name of this appender.
</div> (Inherited from <a href="T_log4net_Appender_AppenderSkeleton.htm">AppenderSkeleton</a>.)</td></tr><tr data="public;declared;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_RollingFileAppender_PreserveLogFileNameExtension.htm">PreserveLogFileNameExtension</a></td><td><div class="summary">
Gets or sets a value indicating whether to preserve the file name extension when rolling.
</div></td></tr><tr data="protected;inherited;notNetfw;"><td><img src="../icons/protproperty.gif" alt="Protected property" title="Protected property" /></td><td><a href="P_log4net_Appender_TextWriterAppender_QuietWriter.htm">QuietWriter</a></td><td><div class="summary">
Gets or sets the <a href="T_log4net_Util_QuietTextWriter.htm">QuietTextWriter</a> where logging events
will be written to.
</div> (Inherited from <a href="T_log4net_Appender_TextWriterAppender.htm">TextWriterAppender</a>.)</td></tr><tr data="protected;inherited;notNetfw;"><td><img src="../icons/protproperty.gif" alt="Protected property" title="Protected property" /></td><td><a href="P_log4net_Appender_TextWriterAppender_RequiresLayout.htm">RequiresLayout</a></td><td><div class="summary">
This appender requires a <a href="N_log4net_Layout.htm">log4net.Layout</a> to be set.
</div> (Inherited from <a href="T_log4net_Appender_TextWriterAppender.htm">TextWriterAppender</a>.)</td></tr><tr data="public;declared;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_RollingFileAppender_RollingStyle.htm">RollingStyle</a></td><td><div class="summary">
Gets or sets the rolling style.
</div></td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_FileAppender_SecurityContext.htm">SecurityContext</a></td><td><div class="summary">
Gets or sets the <a href="P_log4net_Appender_FileAppender_SecurityContext.htm">SecurityContext</a> used to write to the file.
</div> (Inherited from <a href="T_log4net_Appender_FileAppender.htm">FileAppender</a>.)</td></tr><tr data="public;declared;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_RollingFileAppender_StaticLogFileName.htm">StaticLogFileName</a></td><td><div class="summary">
Gets or sets a value indicating whether to always log to
the same file.
</div></td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_AppenderSkeleton_Threshold.htm">Threshold</a></td><td><div class="summary">
Gets or sets the threshold <a href="T_log4net_Core_Level.htm">Level</a> of this appender.
</div> (Inherited from <a href="T_log4net_Appender_AppenderSkeleton.htm">AppenderSkeleton</a>.)</td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubproperty.gif" alt="Public property" title="Public property" /></td><td><a href="P_log4net_Appender_TextWriterAppender_Writer.htm">Writer</a></td><td><div class="summary">
Sets the <a href="http://msdn2.microsoft.com/en-us/library/ywxh2328" target="_blank">TextWriter</a> where the log output will go.
</div> (Inherited from <a href="T_log4net_Appender_TextWriterAppender.htm">TextWriterAppender</a>.)</td></tr></table><a href="#mainBody">Top</a><div class="OH_CollapsibleAreaRegion"><div class="OH_regiontitle">Methods</div><div class="OH_CollapsibleArea_HrDiv"><hr class="OH_CollapsibleArea_Hr" /></div></div><div class="OH_clear"> </div><table id="memberList" class="members"><tr><th class="ps_iconColumn">
 
</th><th>Name</th><th>Description</th></tr><tr data="public;declared;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="M_log4net_Appender_RollingFileAppender_ActivateOptions.htm">ActivateOptions</a></td><td><div class="summary">
Initialize the appender based on the options set
</div> (Overrides <a href="M_log4net_Appender_FileAppender_ActivateOptions.htm">FileAppender<span id="LSTBB37F8A8_5"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_5?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>ActivateOptions<span id="LSTBB37F8A8_6"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_6?cs=()|vb=|cpp=()|nu=()|fs=()");</script></a>.)</td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="M_log4net_Appender_AppenderSkeleton_AddFilter.htm">AddFilter</a></td><td><div class="summary">
Adds a filter to the end of the filter chain.
</div> (Inherited from <a href="T_log4net_Appender_AppenderSkeleton.htm">AppenderSkeleton</a>.)</td></tr><tr data="protected;declared;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_RollingFileAppender_AdjustFileBeforeAppend.htm">AdjustFileBeforeAppend</a></td><td><div class="summary">
Performs any required rolling before outputting the next event
</div></td></tr><tr data="protected;declared;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_RollingFileAppender_Append.htm">Append(LoggingEvent)</a></td><td><div class="summary">
Write out a logging event.
</div> (Overrides <a href="M_log4net_Appender_FileAppender_Append.htm">FileAppender<span id="LSTBB37F8A8_7"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_7?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>Append(LoggingEvent)</a>.)</td></tr><tr data="protected;declared;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_RollingFileAppender_Append_1.htm">Append(<span id="LSTBB37F8A8_8"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_8?cpp=array&lt;");</script>LoggingEvent<span id="LSTBB37F8A8_9"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_9?cpp=&gt;|cs=[]|vb=()|nu=[]|fs=[]");</script>)</a></td><td><div class="summary">
Write out an array of logging events.
</div> (Overrides <a href="M_log4net_Appender_FileAppender_Append_1.htm">FileAppender<span id="LSTBB37F8A8_10"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_10?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>Append(<span id="LSTBB37F8A8_11"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_11?cpp=array&lt;");</script>LoggingEvent<span id="LSTBB37F8A8_12"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_12?cpp=&gt;|cs=[]|vb=()|nu=[]|fs=[]");</script>)</a>.)</td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="M_log4net_Appender_AppenderSkeleton_ClearFilters.htm">ClearFilters</a></td><td><div class="summary">
Clears the filter list for this appender.
</div> (Inherited from <a href="T_log4net_Appender_AppenderSkeleton.htm">AppenderSkeleton</a>.)</td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="M_log4net_Appender_AppenderSkeleton_Close.htm">Close</a></td><td><div class="summary">
Closes the appender and release resources.
</div> (Inherited from <a href="T_log4net_Appender_AppenderSkeleton.htm">AppenderSkeleton</a>.)</td></tr><tr data="protected;inherited;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_FileAppender_CloseFile.htm">CloseFile</a></td><td><div class="summary">
Closes the previously opened file.
</div> (Inherited from <a href="T_log4net_Appender_FileAppender.htm">FileAppender</a>.)</td></tr><tr data="protected;inherited;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_FileAppender_CloseWriter.htm">CloseWriter</a></td><td><div class="summary">
Closes the underlying <a href="http://msdn2.microsoft.com/en-us/library/ywxh2328" target="_blank">TextWriter</a>.
</div> (Inherited from <a href="T_log4net_Appender_FileAppender.htm">FileAppender</a>.)</td></tr><tr data="protected;declared;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_RollingFileAppender_DeleteFile.htm">DeleteFile</a></td><td><div class="summary">
Deletes the specified file if it exists.
</div></td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="M_log4net_Appender_AppenderSkeleton_DoAppend.htm">DoAppend(LoggingEvent)</a></td><td><div class="summary">
Performs threshold checks and invokes filters before
delegating actual logging to the subclasses specific
<span class="nolink">[M:Append(LoggingEvent)]</span> method.
</div> (Inherited from <a href="T_log4net_Appender_AppenderSkeleton.htm">AppenderSkeleton</a>.)</td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="M_log4net_Appender_AppenderSkeleton_DoAppend_1.htm">DoAppend(<span id="LSTBB37F8A8_13"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_13?cpp=array&lt;");</script>LoggingEvent<span id="LSTBB37F8A8_14"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_14?cpp=&gt;|cs=[]|vb=()|nu=[]|fs=[]");</script>)</a></td><td><div class="summary">
Performs threshold checks and invokes filters before
delegating actual logging to the subclasses specific
<span class="nolink">[M:Append(LoggingEvent[])]</span> method.
</div> (Inherited from <a href="T_log4net_Appender_AppenderSkeleton.htm">AppenderSkeleton</a>.)</td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="http://msdn2.microsoft.com/en-us/library/bsc2ak47" target="_blank">Equals</a></td><td><div class="summary">
Determines whether the specified <a href="http://msdn2.microsoft.com/en-us/library/e5kfa45b" target="_blank">Object</a> is equal to the current <a href="http://msdn2.microsoft.com/en-us/library/e5kfa45b" target="_blank">Object</a>.
</div> (Inherited from <a href="http://msdn2.microsoft.com/en-us/library/e5kfa45b" target="_blank">Object</a>.)</td></tr><tr data="protected;declared;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_RollingFileAppender_ExistingInit.htm">ExistingInit</a></td><td><div class="summary">
Initializes based on existing conditions at time of <a href="M_log4net_Appender_RollingFileAppender_ActivateOptions.htm">ActivateOptions<span id="LSTBB37F8A8_15"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_15?cs=()|vb=|cpp=()|nu=()|fs=()");</script></a>.
</div></td></tr><tr data="protected;declared;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_RollingFileAppender_FileExists.htm">FileExists</a></td><td><div class="summary">
Test if a file exists at a specified path
</div></td></tr><tr data="protected;inherited;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_AppenderSkeleton_FilterEvent.htm">FilterEvent</a></td><td><div class="summary">
Test if the logging event should we output by this appender
</div> (Inherited from <a href="T_log4net_Appender_AppenderSkeleton.htm">AppenderSkeleton</a>.)</td></tr><tr data="protected;declared;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_RollingFileAppender_Finalize.htm">Finalize</a></td><td><div class="summary">
Cleans up all resources used by this appender.
</div> (Overrides <a href="M_log4net_Appender_AppenderSkeleton_Finalize.htm">AppenderSkeleton<span id="LSTBB37F8A8_16"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_16?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>Finalize<span id="LSTBB37F8A8_17"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_17?cs=()|vb=|cpp=()|nu=()|fs=()");</script></a>.)</td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="M_log4net_Appender_TextWriterAppender_Flush.htm">Flush</a></td><td><div class="summary">
Flushes any buffered log data.
</div> (Inherited from <a href="T_log4net_Appender_TextWriterAppender.htm">TextWriterAppender</a>.)</td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="http://msdn2.microsoft.com/en-us/library/zdee4b3y" target="_blank">GetHashCode</a></td><td><div class="summary">
Serves as a hash function for a particular type.
</div> (Inherited from <a href="http://msdn2.microsoft.com/en-us/library/e5kfa45b" target="_blank">Object</a>.)</td></tr><tr data="protected;declared;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_RollingFileAppender_GetNextOutputFileName.htm">GetNextOutputFileName</a></td><td><div class="summary">
Get the current output file name
</div></td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="http://msdn2.microsoft.com/en-us/library/dfwy45w9" target="_blank">GetType</a></td><td><div class="summary">
Gets the <a href="http://msdn2.microsoft.com/en-us/library/42892f65" target="_blank">Type</a> of the current instance.
</div> (Inherited from <a href="http://msdn2.microsoft.com/en-us/library/e5kfa45b" target="_blank">Object</a>.)</td></tr><tr data="protected;inherited;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_AppenderSkeleton_IsAsSevereAsThreshold.htm">IsAsSevereAsThreshold</a></td><td><div class="summary">
Checks if the message level is below this appender's threshold.
</div> (Inherited from <a href="T_log4net_Appender_AppenderSkeleton.htm">AppenderSkeleton</a>.)</td></tr><tr data="protected;inherited;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="http://msdn2.microsoft.com/en-us/library/57ctke0a" target="_blank">MemberwiseClone</a></td><td><div class="summary">
Creates a shallow copy of the current <a href="http://msdn2.microsoft.com/en-us/library/e5kfa45b" target="_blank">Object</a>.
</div> (Inherited from <a href="http://msdn2.microsoft.com/en-us/library/e5kfa45b" target="_blank">Object</a>.)</td></tr><tr data="protected;declared;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_RollingFileAppender_NextCheckDate.htm">NextCheckDate</a></td><td><div class="summary">
Get the start time of the next window for the current rollpoint
</div></td></tr><tr data="protected;inherited;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_FileAppender_OnClose.htm">OnClose</a></td><td><div class="summary">
Close this appender instance. The underlying stream or writer is also closed.
</div> (Inherited from <a href="T_log4net_Appender_FileAppender.htm">FileAppender</a>.)</td></tr><tr data="protected;declared;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_RollingFileAppender_OpenFile.htm">OpenFile</a></td><td><div class="summary">
Creates and opens the file for logging. If <a href="P_log4net_Appender_RollingFileAppender_StaticLogFileName.htm">StaticLogFileName</a>
is false then the fully qualified name is determined and used.
</div> (Overrides <a href="M_log4net_Appender_FileAppender_OpenFile.htm">FileAppender<span id="LSTBB37F8A8_18"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_18?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>OpenFile(String, Boolean)</a>.)</td></tr><tr data="protected;inherited;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_TextWriterAppender_PreAppendCheck.htm">PreAppendCheck</a></td><td><div class="summary">
This method determines if there is a sense in attempting to append.
</div> (Inherited from <a href="T_log4net_Appender_TextWriterAppender.htm">TextWriterAppender</a>.)</td></tr><tr data="protected;inherited;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_FileAppender_PrepareWriter.htm">PrepareWriter</a></td><td><div class="summary">
Called to initialize the file writer
</div> (Inherited from <a href="T_log4net_Appender_FileAppender.htm">FileAppender</a>.)</td></tr><tr data="protected;inherited;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_AppenderSkeleton_RenderLoggingEvent.htm">RenderLoggingEvent(LoggingEvent)</a></td><td><div class="summary">
Renders the <a href="T_log4net_Core_LoggingEvent.htm">LoggingEvent</a> to a string.
</div> (Inherited from <a href="T_log4net_Appender_AppenderSkeleton.htm">AppenderSkeleton</a>.)</td></tr><tr data="protected;inherited;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_AppenderSkeleton_RenderLoggingEvent_1.htm">RenderLoggingEvent(TextWriter, LoggingEvent)</a></td><td><div class="summary">
Renders the <a href="T_log4net_Core_LoggingEvent.htm">LoggingEvent</a> to a string.
</div> (Inherited from <a href="T_log4net_Appender_AppenderSkeleton.htm">AppenderSkeleton</a>.)</td></tr><tr data="protected;inherited;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_FileAppender_Reset.htm">Reset</a></td><td><div class="summary">
Closes any previously opened file and calls the parent's <a href="M_log4net_Appender_TextWriterAppender_Reset.htm">Reset<span id="LSTBB37F8A8_19"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_19?cs=()|vb=|cpp=()|nu=()|fs=()");</script></a>.
</div> (Inherited from <a href="T_log4net_Appender_FileAppender.htm">FileAppender</a>.)</td></tr><tr data="protected;declared;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_RollingFileAppender_RollFile.htm">RollFile</a></td><td><div class="summary">
Renames file <span class="parameter">fromFile</span> to file <span class="parameter">toFile</span>.
</div></td></tr><tr data="protected;declared;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_RollingFileAppender_RollOverRenameFiles.htm">RollOverRenameFiles</a></td><td><div class="summary">
Implements file roll.
</div></td></tr><tr data="protected;declared;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_RollingFileAppender_RollOverSize.htm">RollOverSize</a></td><td><div class="summary">
Implements file roll base on file size.
</div></td></tr><tr data="protected;declared;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_RollingFileAppender_RollOverTime.htm">RollOverTime</a></td><td><div class="summary">
Rollover the file(s) to date/time tagged file(s).
</div></td></tr><tr data="protected;inherited;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_FileAppender_SafeOpenFile.htm">SafeOpenFile</a></td><td><div class="summary">
Sets and <i>opens</i> the file where the log output will go. The specified file must be writable.
</div> (Inherited from <a href="T_log4net_Appender_FileAppender.htm">FileAppender</a>.)</td></tr><tr data="protected;inherited;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_FileAppender_SetQWForFiles.htm">SetQWForFiles(Stream)</a></td><td><div class="summary">
Sets the quiet writer used for file output
</div> (Inherited from <a href="T_log4net_Appender_FileAppender.htm">FileAppender</a>.)</td></tr><tr data="protected;declared;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_RollingFileAppender_SetQWForFiles.htm">SetQWForFiles(TextWriter)</a></td><td><div class="summary">
Sets the quiet writer being used.
</div> (Overrides <a href="M_log4net_Appender_FileAppender_SetQWForFiles_1.htm">FileAppender<span id="LSTBB37F8A8_20"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_20?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>SetQWForFiles(TextWriter)</a>.)</td></tr><tr data="public;inherited;notNetfw;"><td><img src="../icons/pubmethod.gif" alt="Public method" title="Public method" /></td><td><a href="http://msdn2.microsoft.com/en-us/library/7bxwbwt2" target="_blank">ToString</a></td><td><div class="summary">
Returns a <a href="http://msdn2.microsoft.com/en-us/library/s1wwdcbf" target="_blank">String</a> that represents the current <a href="http://msdn2.microsoft.com/en-us/library/e5kfa45b" target="_blank">Object</a>.
</div> (Inherited from <a href="http://msdn2.microsoft.com/en-us/library/e5kfa45b" target="_blank">Object</a>.)</td></tr><tr data="protected;inherited;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_FileAppender_WriteFooter.htm">WriteFooter</a></td><td><div class="summary">
Writes a footer as produced by the embedded layout's <a href="P_log4net_Layout_ILayout_Footer.htm">Footer</a> property.
</div> (Inherited from <a href="T_log4net_Appender_FileAppender.htm">FileAppender</a>.)</td></tr><tr data="protected;inherited;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_TextWriterAppender_WriteFooterAndCloseWriter.htm">WriteFooterAndCloseWriter</a></td><td><div class="summary">
Writes the footer and closes the underlying <a href="http://msdn2.microsoft.com/en-us/library/ywxh2328" target="_blank">TextWriter</a>.
</div> (Inherited from <a href="T_log4net_Appender_TextWriterAppender.htm">TextWriterAppender</a>.)</td></tr><tr data="protected;inherited;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_FileAppender_WriteHeader.htm">WriteHeader</a></td><td><div class="summary">
Writes a header produced by the embedded layout's <a href="P_log4net_Layout_ILayout_Header.htm">Header</a> property.
</div> (Inherited from <a href="T_log4net_Appender_FileAppender.htm">FileAppender</a>.)</td></tr></table><a href="#mainBody">Top</a><div class="OH_CollapsibleAreaRegion"><div class="OH_regiontitle">Remarks</div><div class="OH_CollapsibleArea_HrDiv"><hr class="OH_CollapsibleArea_Hr" /></div></div><div class="OH_clear"> </div><p>
RollingFileAppender can roll log files based on size or date or both
depending on the setting of the <a href="P_log4net_Appender_RollingFileAppender_RollingStyle.htm">RollingStyle</a> property.
When set to <a href="T_log4net_Appender_RollingFileAppender_RollingMode.htm">Size</a> the log file will be rolled
once its size exceeds the <a href="P_log4net_Appender_RollingFileAppender_MaximumFileSize.htm">MaximumFileSize</a>.
When set to <a href="T_log4net_Appender_RollingFileAppender_RollingMode.htm">Date</a> the log file will be rolled
once the date boundary specified in the <a href="P_log4net_Appender_RollingFileAppender_DatePattern.htm">DatePattern</a> property
is crossed.
When set to <a href="T_log4net_Appender_RollingFileAppender_RollingMode.htm">Composite</a> the log file will be
rolled once the date boundary specified in the <a href="P_log4net_Appender_RollingFileAppender_DatePattern.htm">DatePattern</a> property
is crossed, but within a date boundary the file will also be rolled
once its size exceeds the <a href="P_log4net_Appender_RollingFileAppender_MaximumFileSize.htm">MaximumFileSize</a>.
When set to <a href="T_log4net_Appender_RollingFileAppender_RollingMode.htm">Once</a> the log file will be rolled when
the appender is configured. This effectively means that the log file can be
rolled once per program execution.
</p><p>
A of few additional optional features have been added:
<ul><li>Attach date pattern for current log file <a href="P_log4net_Appender_RollingFileAppender_StaticLogFileName.htm">StaticLogFileName</a></li><li>Backup number increments for newer files <a href="P_log4net_Appender_RollingFileAppender_CountDirection.htm">CountDirection</a></li><li>Infinite number of backups by file size <a href="P_log4net_Appender_RollingFileAppender_MaxSizeRollBackups.htm">MaxSizeRollBackups</a></li></ul></p><div class="alert"><table><tr><th><img src="../icons/alert_note.gif" alt="Note" /> Note</th></tr><tr><td><p>
For large or infinite numbers of backup files a <a href="P_log4net_Appender_RollingFileAppender_CountDirection.htm">CountDirection</a>
greater than zero is highly recommended, otherwise all the backup files need
to be renamed each time a new backup is created.
</p><p>
When Date/Time based rolling is used setting <a href="P_log4net_Appender_RollingFileAppender_StaticLogFileName.htm">StaticLogFileName</a>
to <span class="keyword"><span id="LSTBB37F8A8_21"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_21?vb=True|nu=true");</script></span> will reduce the number of file renamings to few or none.
</p></td></tr></table></div><div class="alert"><table><tr><th><img src="../icons/alert_caution.gif" alt="Caution note" /> Caution</th></tr><tr><td><p>
Changing <a href="P_log4net_Appender_RollingFileAppender_StaticLogFileName.htm">StaticLogFileName</a> or <a href="P_log4net_Appender_RollingFileAppender_CountDirection.htm">CountDirection</a> without clearing
the log file directory of backup files will cause unexpected and unwanted side effects.
</p></td></tr></table></div><p>
If Date/Time based rolling is enabled this appender will attempt to roll existing files
in the directory without a Date/Time tag based on the last write date of the base log file.
The appender only rolls the log file when a message is logged. If Date/Time based rolling
is enabled then the appender will not roll the log file at the Date/Time boundary but
at the point when the next message is logged after the boundary has been crossed.
</p><p>
The <span class="selflink">RollingFileAppender</span> extends the <a href="T_log4net_Appender_FileAppender.htm">FileAppender</a> and
has the same behavior when opening the log file.
The appender will first try to open the file for writing when <a href="M_log4net_Appender_RollingFileAppender_ActivateOptions.htm">ActivateOptions<span id="LSTBB37F8A8_22"></span><script type="text/javascript">AddLanguageSpecificTextSet("LSTBB37F8A8_22?cs=()|vb=|cpp=()|nu=()|fs=()");</script></a>
is called. This will typically be during configuration.
If the file cannot be opened for writing the appender will attempt
to open the file again each time a message is logged to the appender.
If the file cannot be opened for writing when a message is logged then
the message will be discarded by this appender.
</p><p>
When rolling a backup file necessitates deleting an older backup file the
file to be deleted is moved to a temporary name before being deleted.
</p><div class="alert"><table><tr><th><img src="../icons/alert_caution.gif" alt="Caution note" /> Caution</th></tr><tr><td><p>
A maximum number of backup files when rolling on date/time boundaries is not supported.
</p></td></tr></table></div><div class="OH_CollapsibleAreaRegion" id="seeAlsoSection"><div class="OH_regiontitle">See Also</div><div class="OH_CollapsibleArea_HrDiv"><hr class="OH_CollapsibleArea_Hr" /></div></div><div class="OH_clear"> </div><h4 class="subHeading">Reference</h4><div class="seeAlsoStyle"><a href="N_log4net_Appender.htm">log4net.Appender Namespace</a></div></div></div></div></div><div id="OH_footer" class="OH_footer">Apache log4net, Apache and log4net are trademarks of The Apache Software Foundation.<p><a href="http://logging.apache.org/log4net/" target="_blank">Copyright 2004-2017 The Apache Software Foundation</a></p><div class="OH_feedbacklink">Send comments on this topic to
<a id="HT_MailLink" href="mailto:http%3A%2F%2Flogging.apache.org%2Flog4net%2Fmail-lists.html?Subject=Apache log4net™ SDK Documentation">http://logging.apache.org/log4net/mail-lists.html</a></div><script type="text/javascript">
var HT_mailLink = document.getElementById("HT_MailLink");
var HT_mailLinkText = HT_mailLink.innerHTML;
HT_mailLink.href += ": " + document.title + "\u0026body=" + encodeURIComponent("Your feedback is used to improve the documentation and the product. Your e-mail address will not be used for any other purpose and is disposed of after the issue you report is resolved. While working to resolve the issue that you report, you may be contacted via e-mail to get further details or clarification on the feedback you sent. After the issue you report has been addressed, you may receive an e-mail to let you know that your feedback has been addressed.");
HT_mailLink.innerHTML = HT_mailLinkText;
</script> </div></body></html>