[This is preliminary documentation and is subject to change.]

The net4log appender that submits reports to bugcollect.com.

Namespace:  bugcollect4net
Assembly:  bugcollect4net (in bugcollect4net.dll) Version: 1.2.10.0 (1.2.10.0)

Syntax

C#
public class BugcollectAppender : BufferingAppenderSkeleton
Visual Basic (Declaration)
Public Class BugcollectAppender _
	Inherits BufferingAppenderSkeleton

Remarks

log4net is a popular logging framework that allows applications to output log statements to a variety of output targets. This class allows log4net application to output the log to bugcollect.com as incident reports.
The bugcollect.com appender is a buffering appender and is based on the log4net.Appender.BufferingAppenderSkeleton skeleton. It submits one single Report for all logging events retained prior to the buffer flush. All logging events are formatted using the configured log4net layout. The resulted text is attached to the Notes of the submitted report. The exception or the location of the last logging event is used to set the report StackTrace. This way on typical log4net configurations, when the buffered appender is configured to send reports only when logging events occur that exceed a treshold severity, the logging events occuring prior to the send triggering event are reported as a captured log of the events that led to the event triggering the report, while the last event is reported as the cause of the report.

Examples

The BugcollecttAppender fits into your already existing log4net infrastructure. It can be added to any existing application that uses log4net by simply changing the application log4net configuration. This is a simple example how to use log4net:
CopyC#
ILog log = LogManager.GetLogger("application");

log.Info("Application Start");
log.Debug("This is a debug message");

if (log.IsDebugEnabled)
{
    log.Debug("This is another debug message");
}
For more examples of how to use log4net in your application, please refer to the log4net documentation.
The following example shows how to add the BugcollectAppender to an log4net application, using the application configuration file:
CopyC#
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
    </configSections>
    <log4net>
        <appender name="BugcollectAppender" type="bugcollect4net.BugcollectAppender, bugcollect4net">
            <layout type="log4net.Layout.PatternLayout">
                <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
            </layout>
            <messagelayout type="log4net.Layout.PatternLayout">
                <conversionPattern value="%message%newline" />
            </messagelayout>
            <evaluator type="log4net.Core.LevelEvaluator">
                <threshold value="WARN"/>
            </evaluator>
            <applicationName value="<your application name>"/>
            <applicationPassword value="<your application password>"/>
        </appender>
        <root>
            <level value="INFO" />
            <appender-ref ref="BugcollectAppender" />
        </root>
    </log4net>
</configuration>

Inheritance Hierarchy

System..::.Object
  AppenderSkeleton
    BufferingAppenderSkeleton
      bugcollect4net..::.BugcollectAppender

See Also