• Index all log4net messages directly to Elasticsearch
  • Compatible with .NET 4+
  • Use either the direct insert or bulk Elasticsearch API for improved efficiency and performance
  • Log to a single index or automatically create rolling daily indices
  • No dependencies (other than log4net)
  • Fully open source, MIT licensed
  • Convenient installation via Nuget (see below)

The log4net.ElasticSearch library can be installed from NuGet:
PM> Install-Package log4net.elasticsearch

Elasticsearch Log Document Example

  "_source": {
    "message""Something broke.",
    "messageObject": { },
    "exception": {
      "Message""There was a system error",
      "Data": {
    "fix""LocationInfo, UserName, Identity, Partial",
    "properties": {

Samples & Documentation

log4net.ElasticSearch comes with comprehensible documentation, examples, and a sample project which can be downloaded or cloned directly from Github. Check out the GETTING STARTED section to learn about configuration options and performance considerations. Happy logging!

  • Getting Started contains a further explanation of the configuration options.

  • The examples section has several log4net configuration options which you can use to tweak the way messages are logged to Elasticsearch.

Contributing & Copyright

log4net.ElasticSearch is hosted on GitHub where you can report issues, fork the project and submit pull requests. If you're adding code or functionality, please also add unit and integration tests.

log4net.ElasticSearch is available under the MIT license, which allows modification and redistribution for both commercial and non-commercial purposes. This web site / template is borrowed and modified from the FSProjects Scaffolding repository because I find it quite nice and convenient for users. They do some great work over there. Consider using the Paket package manager for some of your work.

Fork me on GitHub