FileAppender SafeOpenFile Method | Apache log4net™ SDK Documentation

Sets and opens the file where the log output will go. The specified file must be writable.

Namespace: log4net.Appender
Assembly: log4net (in log4net.dll) Version: 2.0.8.0-.NET 4.0
Syntax

C#
VB
C++
F#
Copy

    protected virtual void SafeOpenFile(
    	string fileName,
    	bool append
    )

    Protected Overridable Sub SafeOpenFile (
    	fileName As String,
    	append As Boolean
    )

    protected:
    virtual void SafeOpenFile(
    	String^ fileName,
    	bool append
    )

    abstract SafeOpenFile :
            fileName : string *
            append : bool -> unit
    override SafeOpenFile :
            fileName : string *
            append : bool -> unit

#### Parameters

fileName
  Type: System
  String
  The path to the log file. Must be a fully qualified path.
append
  Type: System
  Boolean
  If true will append to fileName. Otherwise will truncate fileName

Remarks

Calls OpenFile(String, Boolean) but guarantees not to throw an exception. Errors are passed to the ErrorHandler.

See Also

#### Reference

FileAppender Class
log4net.Appender Namespace