Start your 14-day free trial today & Get 20% Off All Annual Managed ELK Plans

No Credit Card Required

Try Free

Already have an account? Sign In

Send data via NLog to your Logstash instance provided by

Nlog Logstash Setup

Ship logs from your .NET application to logstash

Use the NLog configuration example below to ship logs from your .NET application to Logstash

Step 1 - InstallCopy

Installing NLog Install NLog from Nuget. For .NET:

Install-Package NLog

For .NET Core:

Install-Package NLog.Web.AspNetCore

Step 2 - Configuring NLogCopy

Configuring NLog can be done in your application app.config or web.config.

Step 3 - Using NLogCopy

In order to emit log message you can simply call one of the methods on the Logger.

using NLog;

public class MyClass
  private static Logger logger = LogManager.GetCurrentClassLogger();
  public void MyMethod1()
    logger.Info("Sample trace message");
    //below is an example of structured logging 
    logger.Info("Logon by {user} from {ip_address}", "GreatestUser", "");

NLog is a fully featured logging platform for .NET developers that provides many quality of life benefits. For more configuration options please see the Nlog Documentation. For more information about structured logging please see here and here for a comprehensive tutorial about setting up and using NLog.

Step 4 - NLog Logger OverviewCopy

NLog is a free open source logging platform for .NET & .NET Core, that is often compared to Serilog & Log4net. NLog is well known for being easy to use & is highly flexible alongside its high performance capabilities.

NLog also provides support for structured log data & covers a huge range of data targets and formats. NLog is able to note a variety of log severities including (by descending priority); Fatal, Error, Warn, Info, Debug & Trace.

While NLog itself is a logging platform, the service also creates internal application logs of its own that many users find extremely hard to troubleshoot & parse without the use of a tool like Hosted Logstash.

Our platform offers Hosted Logstash alongside Elasticsearch & Kibana to help you view the entirety of your Nlog & .Net log files (among hundreds of other popular data sources) in a single source of truth.

If after following our NLog documentation you require any additional assistance with analysing your NLog or .Net logs we're here to help. Just reach out by contacting our support team via live chat & we'll be happy to help you get started.

Toggle View

Expand View

Return to Search