UptoLog logo Create Account or Sign In

Integrating log4net with UptoLog Satellite

By using the UptoLog Satellite log4net appender component, UptoLog Satellite can be used as an output logging target for log4net.

The UptoLog Satellite log4net appender supports log4net version 1.2.10.

You can download and use the UptoLog Satellite log4net appender C# source code and component for free. You can change and use the source code as you like.
The UptoLog Satellite log4net appender is a .NET 2.0 application and integrates with UptoLog Satellite which does the actual logging to the UptoLog Log Server.

Test applications

The UptoLog Satellite log4net appender source code is located in a Visual Studio 2008 solution also containing test applications which is .NET 3.5 applications. The test applications logs to the online UptoLog Log Server for testing. The logs can subsequently be seen through the online UptoLog Search Server for testing.

If you want the test applications to log to your own UptoLog Log Server, change the UptoLog Log Server URL in all config files to point at your own server.

Using the UptoLog Satellite log4net appender

Include the components UptoLog Satellite, UptoLog Satellite log4net appender and log4net in your project and configure log4net.

Including UptoLog Satellite
After UptoLog Satellite is installed on the development client, the UptoLog Satellite component is found under: Windows Start menu --> UptoLog Satellite --> UptoLog Satellite library.

UptoLog Satellite is added to a project by creating a component folder in the project and copying the two files UptoLog.Satellite.dll and UptoLog.Satellite.xml to the folder. Afterwards add a reference to UptoLog.Satellite.dll in the project(s), which should use log4net.

Including UptoLog Satellite log4net appender
Download the UptoLog Satellite log4net appender component. The component is added to a project by copying the file UptoLog.Satellite.log4net.Appender.dll to the component folder. Afterwards add a reference to UptoLog.Satellite.log4net.Appender.dll in the project(s), which should use log4net.

Including log4net
If you haven’t already downloaded and included log4net, download the log4net component. Log4net is added to a project by copying the file log4net.dll to the component folder. Afterwards add a reference to log4net.dll in the project(s), which should use log4net.

Configuring log4net
log4net is configured to use the UptoLog Satellite log4net appender. Configure which UptoLog Log Server should receive the logs and configure the log level. The log level controls which logs log4net are routing to UptoLog Satellite.

log4net configuration section is included in the configuration element in the config file as follows:
<configSections>
 <section name="log4net"
  type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"
/>
</configSections>

log4net is configured to use the UptoLog Satellite log4net appender and the UptoLog Log Servers URL and the log level is configured as follows:
<log4net>
 <appender name="UptoLogAppender"
  type="UptoLog.Satellite.log4net.Appender.UptoLogAppender,
   UptoLog.Satellite.log4net.Appender
"
/>
 <root>
  <level value="INFO" />
  <appender-ref ref="UptoLogAppender" />
 </root>
</log4net>


Mapping log4net levels to UptoLog log types
log4net categorizes logs into levels and UptoLog categorizes logs into log types and levels of error.

The mapping between log4net and UptoLog is done like this:
log4netUptoLog
DEBUG and INFO Trace
WARNWarning
ERRORError
FATALFatal Error

ITfoxtec - Aarhus - Denmark - Phone: +45 24858264 - E-mail: support@uptolog.com - CVR-number: 30 59 65 01