Table of Contents

Class LogLog

Namespace
log4net.Util
Assembly
log4net.dll

Outputs log statements from within the log4net assembly.

public sealed class LogLog
Inheritance
LogLog
Inherited Members

Remarks

Log4net components cannot make log4net logging calls. However, it is sometimes useful for the user to learn about what log4net is doing.

All log4net internal debug calls go to the standard output stream whereas internal error messages are sent to the standard error output stream.

Constructors

LogLog(Type, string, string, Exception)

Initializes a new instance of the LogLog class.

public LogLog(Type source, string prefix, string message, Exception exception)

Parameters

source Type
prefix string
message string
exception Exception

Properties

EmitInternalMessages

public static bool EmitInternalMessages { get; set; }

Property Value

bool

Exception

The Exception related to the message.

public Exception Exception { get; }

Property Value

Exception

Remarks

Optional. Will be null if no Exception was passed.

InternalDebugging

Gets or sets a value indicating whether log4net internal logging is enabled or disabled.

public static bool InternalDebugging { get; set; }

Property Value

bool

true if log4net internal logging is enabled, otherwise false.

Examples

The following example enables internal debugging using the application configuration file :

Remarks

When set to true, internal debug level logging will be displayed.

This value can be set by setting the application setting log4net.Internal.Debug in the application configuration file.

The default value is false, i.e. debugging is disabled.

IsDebugEnabled

Test if LogLog.Debug is enabled for output.

public static bool IsDebugEnabled { get; }

Property Value

bool

true if Debug is enabled

Remarks

Test if LogLog.Debug is enabled for output.

IsErrorEnabled

Test if LogLog.Error is enabled for output.

public static bool IsErrorEnabled { get; }

Property Value

bool

true if Error is enabled

Remarks

Test if LogLog.Error is enabled for output.

IsWarnEnabled

Test if LogLog.Warn is enabled for output.

public static bool IsWarnEnabled { get; }

Property Value

bool

true if Warn is enabled

Remarks

Test if LogLog.Warn is enabled for output.

Message

The internal log message.

public string Message { get; }

Property Value

string

Prefix

A string indicating the severity of the internal message.

public string Prefix { get; }

Property Value

string

Remarks

"log4net: ", "log4net:ERROR ", "log4net:WARN "

QuietMode

Gets or sets a value indicating whether log4net should generate no output from internal logging, not even for errors.

public static bool QuietMode { get; set; }

Property Value

bool

true if log4net should generate no output at all from internal logging, otherwise false.

Examples

The following example disables internal logging using the application configuration file :

Remarks

When set to true will cause internal logging at all levels to be suppressed. This means that no warning or error reports will be logged. This option overrides the InternalDebugging setting and disables all debug also.

This value can be set by setting the application setting log4net.Internal.Quiet in the application configuration file.

The default value is false, i.e. internal logging is not disabled.

Source

The Type that generated the internal message.

public Type Source { get; }

Property Value

Type

TimeStamp

The DateTime stamp of when the internal message was received.

public DateTime TimeStamp { get; }

Property Value

DateTime

Methods

Debug(Type, string)

Writes log4net internal debug messages to the standard output stream.

public static void Debug(Type source, string message)

Parameters

source Type
message string

The message to log.

Remarks

All internal debug messages are prepended with the string "log4net: ".

Debug(Type, string, Exception)

Writes log4net internal debug messages to the standard output stream.

public static void Debug(Type source, string message, Exception exception)

Parameters

source Type

The Type that generated this message.

message string

The message to log.

exception Exception

An exception to log.

Remarks

All internal debug messages are prepended with the string "log4net: ".

Error(Type, string)

Writes log4net internal error messages to the standard error stream.

public static void Error(Type source, string message)

Parameters

source Type

The Type that generated this message.

message string

The message to log.

Remarks

All internal error messages are prepended with the string "log4net:ERROR ".

Error(Type, string, Exception)

Writes log4net internal error messages to the standard error stream.

public static void Error(Type source, string message, Exception exception)

Parameters

source Type

The Type that generated this message.

message string

The message to log.

exception Exception

An exception to log.

Remarks

All internal debug messages are prepended with the string "log4net:ERROR ".

OnLogReceived(Type, string, string, Exception)

Raises the LogReceived event when an internal messages is received.

public static void OnLogReceived(Type source, string prefix, string message, Exception exception)

Parameters

source Type
prefix string
message string
exception Exception

ToString()

Formats Prefix, Source, and Message in the same format as the value sent to Console.Out and Trace.Write.

public override string ToString()

Returns

string

Warn(Type, string)

Writes log4net internal warning messages to the standard error stream.

public static void Warn(Type source, string message)

Parameters

source Type

The Type that generated this message.

message string

The message to log.

Remarks

All internal warning messages are prepended with the string "log4net:WARN ".

Warn(Type, string, Exception)

Writes log4net internal warning messages to the standard error stream.

public static void Warn(Type source, string message, Exception exception)

Parameters

source Type

The Type that generated this message.

message string

The message to log.

exception Exception

An exception to log.

Remarks

All internal warning messages are prepended with the string "log4net:WARN ".

Events

LogReceived

The event raised when an internal message has been received.

public static event LogReceivedEventHandler LogReceived

Event Type

LogReceivedEventHandler