For the complete documentation index, see llms.txt. This page is also available as Markdown.

Logging

Configure logging in GridGain.NET, including writing through IIgnite.Logger, custom ILogger implementations, and the NLog and log4net integrations.

Overview

By default, Ignite uses underlying the Java log4j logging system. Log messages from both .NET and Java are recorded there. You can also write to this log via an IIgnite.Logger instance:

var ignite = Ignition.Start();
ignite.Logger.Info("Hello World!");

LoggerExtensions class provides convenient shortcuts for ILogger.Log method.

Custom Logger

You can provide a logger implementation via the IgniteConfiguration.Logger and ILogger interface. Messages from both .NET and Java will be redirected there.

var cfg = new IgniteConfiguration
{
  Logger = new MemoryLogger()
}

var ignite = Ignition.Start();

class MemoryLogger : ILogger
{
  // Logger can be called from multiple threads, use concurrent collection
  private readonly ConcurrentBag<string> _messages = new ConcurrentBag<string>();

  public void Log(LogLevel level, string message, object[] args,
                  IFormatProvider formatProvider, string category,
                  string nativeErrorInfo, Exception ex)
  {
    _messages.Add(message);
  }

  public bool IsEnabled(LogLevel level)
  {
    // Accept any level.
    return true;
  }
}

NLog & log4net Loggers

GridGain.NET provides ILogger implementations for NLog and Apache log4net. They are included in the binary package (Apache.Ignite.NLog.dll and Apache.Ignite.Log4Net.dll) and can be installed via NuGet:

  • Install-Package Apache.Ignite.NLog

  • Install-Package Apache.Ignite.Log4Net

NLog and Log4Net use statically defined configuration, so there is nothing to configure in Ignite besides IgniteConfiguration.Logger:

A simple file-based logging with NLog can be set up like this:

This page is: Copyright © 2026 MariaDB. All rights reserved.

spinner

Last updated

Was this helpful?