Ads by Lake Quincy Media
Gibraltar - Learn about the best analysis tool for NLog

Archive for November, 2009

Creating multiple log files from a File target

One of the most of commonly used targets in NLog is the File target. In the simplest case it is used to write entries to a single log file, but it supports many more advanced scenarios.  In this post I’m going to explain how to get NLog to write to multiple log files based on contextual information and how to make it work fast even in complex scenarios.

(more…)

Ads by Lake Quincy Media

Gibraltar adapter for NLog released

The Gibraltar Adapter for NLog provides log management and analysis for NLog data. With Gibraltar you can easily send logs from your applications to a central location where they can be analyzed in Gibraltar Analyst.

If you are need a powerful log analyzer for NLog that goes beyond simple filtering and grouping and can scale as your application grows, you should check out Gibraltar.

I found this tool to be a really awesome complement to NLog. The guys behind Gibraltar were generous enough to offer me a commission if any NLog users buy their tool. So, check it out, and if you like it and decide to buy it, you’ll be supporting NLog development too, which I’d be grateful for.

Configuring the adapter

Integrating the adapter into your application is trivial and can be done without even having to recompile it. If you want to route all your logs through Gibraltar all you have to do is put the following XML in your NLog.config:

<nlog>
  <extensions>
    <add assembly="Gibraltar.Agent.NLog" />
  </extensions>
  <targets>
    <target name="Gibraltar" xsi:type="Gibraltar" />
  </targets>
  <rules>
    <logger name="*" minlevel="Trace" writeTo="Gibraltar" />
  </rules>
</nlog>

If you prefer not to ship the configuration file, just add this code to your Main() method instead:

NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(NLog.LogLevel.Trace,
    new Gibraltar.Agent.NLog.GibraltarTarget());