blob: 24006ad8829ac63872fcc9da9844ae6c00cb47d3 [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>FileAppender Class</title><meta name="Language" content="en-us" /><meta name="System.Keywords" content="FileAppender class" /><meta name="System.Keywords" content="log4net.Appender.FileAppender class" /><meta name="System.Keywords" content="FileAppender class, about FileAppender class" /><meta name="Microsoft.Help.F1" content="log4net.Appender.FileAppender" /><meta name="Microsoft.Help.Id" content="T:log4net.Appender.FileAppender" /><meta name="Description" content="Appends logging events to a file." /><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_FileAppender" /><meta name="guid" content="T_log4net_Appender_FileAppender" /></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">FileAppender 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">
Appends logging events to a file.
</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="LST4D272B67_0"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_0?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>Object</a><br />  <a href="T_log4net_Appender_AppenderSkeleton.htm">log4net.Appender<span id="LST4D272B67_1"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_1?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>AppenderSkeleton</a><br />    <a href="T_log4net_Appender_TextWriterAppender.htm">log4net.Appender<span id="LST4D272B67_2"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_2?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>TextWriterAppender</a><br />      <span class="selflink">log4net.Appender<span id="LST4D272B67_3"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_3?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>FileAppender</span><br />        <a href="T_log4net_Appender_RollingFileAppender.htm">log4net.Appender<span id="LST4D272B67_4"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_4?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>RollingFileAppender</a><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">FileAppender</span> : <span class="identifier">TextWriterAppender</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">FileAppender</span>
<span class="keyword">Inherits</span> <span class="identifier">TextWriterAppender</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">FileAppender</span> : <span class="keyword">public</span> <span class="identifier">TextWriterAppender</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">FileAppender</span> =
<span class="keyword">class</span>
<span class="keyword">inherit</span> <span class="identifier">TextWriterAppender</span>
<span class="keyword">end</span></pre></div></div></div><script type="text/javascript">AddLanguageTabSet("ID0EDCA");</script><p>The <span class="selflink">FileAppender</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_FileAppender__ctor.htm">FileAppender<span id="LST4D272B67_5"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_5?cs=()|vb=|cpp=()|nu=()|fs=()");</script></a></td><td><div class="summary">
Default constructor
</div></td></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_FileAppender__ctor_1.htm">FileAppender(ILayout, String)</a></td><td> <strong>Obsolete. </strong><div class="summary">
Construct a new appender using the layout and file specified.
The file will be appended to.
</div></td></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_FileAppender__ctor_2.htm">FileAppender(ILayout, String, Boolean)</a></td><td> <strong>Obsolete. </strong><div class="summary">
Construct a new appender using the layout, file and append mode.
</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;declared;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></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_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></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;declared;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></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;declared;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></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="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_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></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_FileAppender_ActivateOptions.htm">ActivateOptions</a></td><td><div class="summary">
Activate the options on the file appender.
</div> (Overrides <a href="M_log4net_Appender_AppenderSkeleton_ActivateOptions.htm">AppenderSkeleton<span id="LST4D272B67_6"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_6?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>ActivateOptions<span id="LST4D272B67_7"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_7?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_FileAppender_Append.htm">Append(LoggingEvent)</a></td><td><div class="summary">
This method is called by the <span class="nolink">DoAppend(LoggingEvent)</span>
method.
</div> (Overrides <a href="M_log4net_Appender_TextWriterAppender_Append.htm">TextWriterAppender<span id="LST4D272B67_8"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_8?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_FileAppender_Append_1.htm">Append(<span id="LST4D272B67_9"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_9?cpp=array&lt;");</script>LoggingEvent<span id="LST4D272B67_10"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_10?cpp=&gt;|cs=[]|vb=()|nu=[]|fs=[]");</script>)</a></td><td><div class="summary">
This method is called by the <span class="nolink">DoAppend(<span id="LST4D272B67_11"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_11?cpp=array&lt;");</script>LoggingEvent<span id="LST4D272B67_12"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_12?cpp=&gt;|cs=[]|vb=()|nu=[]|fs=[]");</script>)</span>
method.
</div> (Overrides <a href="M_log4net_Appender_TextWriterAppender_Append_1.htm">TextWriterAppender<span id="LST4D272B67_13"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_13?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>Append(<span id="LST4D272B67_14"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_14?cpp=array&lt;");</script>LoggingEvent<span id="LST4D272B67_15"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_15?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;declared;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></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_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> (Overrides <a href="M_log4net_Appender_TextWriterAppender_CloseWriter.htm">TextWriterAppender<span id="LST4D272B67_16"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_16?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>CloseWriter<span id="LST4D272B67_17"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_17?cs=()|vb=|cpp=()|nu=()|fs=()");</script></a>.)</td></tr><tr data="protected;static;declared;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /><img src="../icons/static.gif" alt="Static member" title="Static member" /></td><td><a href="M_log4net_Appender_FileAppender_ConvertToFullPath.htm">ConvertToFullPath</a></td><td><div class="summary">
Convert a path into a fully qualified path.
</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="LST4D272B67_18"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_18?cpp=array&lt;");</script>LoggingEvent<span id="LST4D272B67_19"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_19?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;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;inherited;notNetfw;"><td><img src="../icons/protmethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="M_log4net_Appender_AppenderSkeleton_Finalize.htm">Finalize</a></td><td><div class="summary">
Finalizes this appender by calling the implementation's
<a href="M_log4net_Appender_AppenderSkeleton_Close.htm">Close<span id="LST4D272B67_20"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_20?cs=()|vb=|cpp=()|nu=()|fs=()");</script></a> 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_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="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_FileAppender_OnClose.htm">OnClose</a></td><td><div class="summary">
Close this appender instance. The underlying stream or writer is also closed.
</div> (Overrides <a href="M_log4net_Appender_TextWriterAppender_OnClose.htm">TextWriterAppender<span id="LST4D272B67_21"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_21?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>OnClose<span id="LST4D272B67_22"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_22?cs=()|vb=|cpp=()|nu=()|fs=()");</script></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_FileAppender_OpenFile.htm">OpenFile</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></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;declared;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> (Overrides <a href="M_log4net_Appender_TextWriterAppender_PrepareWriter.htm">TextWriterAppender<span id="LST4D272B67_23"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_23?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>PrepareWriter<span id="LST4D272B67_24"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_24?cs=()|vb=|cpp=()|nu=()|fs=()");</script></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;declared;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="LST4D272B67_25"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_25?cs=()|vb=|cpp=()|nu=()|fs=()");</script></a>.
</div> (Overrides <a href="M_log4net_Appender_TextWriterAppender_Reset.htm">TextWriterAppender<span id="LST4D272B67_26"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_26?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>Reset<span id="LST4D272B67_27"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_27?cs=()|vb=|cpp=()|nu=()|fs=()");</script></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_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></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_FileAppender_SetQWForFiles.htm">SetQWForFiles(Stream)</a></td><td><div class="summary">
Sets the quiet writer used for file output
</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_FileAppender_SetQWForFiles_1.htm">SetQWForFiles(TextWriter)</a></td><td><div class="summary">
Sets the quiet writer being used.
</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/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;declared;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> (Overrides <a href="M_log4net_Appender_TextWriterAppender_WriteFooter.htm">TextWriterAppender<span id="LST4D272B67_28"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_28?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>WriteFooter<span id="LST4D272B67_29"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_29?cs=()|vb=|cpp=()|nu=()|fs=()");</script></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;declared;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> (Overrides <a href="M_log4net_Appender_TextWriterAppender_WriteHeader.htm">TextWriterAppender<span id="LST4D272B67_30"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_30?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>WriteHeader<span id="LST4D272B67_31"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_31?cs=()|vb=|cpp=()|nu=()|fs=()");</script></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>
Logging events are sent to the file specified by
the <a href="P_log4net_Appender_FileAppender_File.htm">File</a> property.
</p><p>
The file can be opened in either append or overwrite mode
by specifying the <a href="P_log4net_Appender_FileAppender_AppendToFile.htm">AppendToFile</a> property.
If the file path is relative it is taken as relative from
the application base directory. The file encoding can be
specified by setting the <a href="P_log4net_Appender_FileAppender_Encoding.htm">Encoding</a> property.
</p><p>
The layout's <a href="P_log4net_Layout_ILayout_Header.htm">Header</a> and <a href="P_log4net_Layout_ILayout_Footer.htm">Footer</a>
values will be written each time the file is opened and closed
respectively. If the <a href="P_log4net_Appender_FileAppender_AppendToFile.htm">AppendToFile</a> property is <span class="keyword"><span id="LST4D272B67_32"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_32?vb=True|nu=true");</script></span>
then the file may contain multiple copies of the header and footer.
</p><p>
This appender will first try to open the file for writing when <a href="M_log4net_Appender_FileAppender_ActivateOptions.htm">ActivateOptions<span id="LST4D272B67_33"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_33?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>
The <span class="selflink">FileAppender</span> supports pluggable file locking models via
the <a href="P_log4net_Appender_FileAppender_LockingModel.htm">LockingModel</a> property.
The default behavior, implemented by <a href="T_log4net_Appender_FileAppender_ExclusiveLock.htm">FileAppender<span id="LST4D272B67_34"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_34?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>ExclusiveLock</a>
is to obtain an exclusive write lock on the file until this appender is closed.
The alternative models only hold a
write lock while the appender is writing a logging event (<a href="T_log4net_Appender_FileAppender_MinimalLock.htm">FileAppender<span id="LST4D272B67_35"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_35?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>MinimalLock</a>)
or synchronize by using a named system wide Mutex (<a href="T_log4net_Appender_FileAppender_InterProcessLock.htm">FileAppender<span id="LST4D272B67_36"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST4D272B67_36?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>InterProcessLock</a>).
</p><p>
All locking strategies have issues and you should seriously consider using a different strategy that
avoids having multiple processes logging to the same file.
</p><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>