talira

Apache log4net

A logging library for .NET

open sourceApache-2.0free

Apache log4net is a logging library for .NET that writes log statements to many output targets. Built-in appenders write to files, network sockets, databases, SMTP servers and more; layouts render text, XML, JSON or Syslog; and filters select by level or regular expression. Logging is configured outside the application binary and can be turned on at runtime, and log4net reloads its configuration when it changes without losing log events. It is a project of the Apache Software Foundation.

Problems it solves

  • add logging to a .NET application with output to files and databases
  • turn on logging in a running .NET app without recompiling
  • write C# logs as JSON or to Syslog
  • rotate log files in a .NET Framework application

Features

  • appenders for files, sockets, databases, SMTP and more
  • text, XML, JSON and Syslog layouts
  • level and regex filters
  • configuration reloads without losing events
  • runtime configuration without changing the binary

Alternatives

The same job

These do what Apache log4net does.

  1. Serilog Simple .NET logging with fully structured events

Compare Apache log4net with the top 3