Ben Hyrman

Logging from RavenDB to Seq

The following applies to Raven 2.5. It might apply to later versions as well...

We've settled on Seq for our logging aggregator. Our apps log messages locally and to a Seq instance and everything just plain works. However, we were left with some gaps on our RavenDB instances. So, the task for today was to figure out how to wire up RavenDB, which uses NLog, to send its log messages to our Seq instance.

The venerable Nicholas Blumhardt has an NLog-to-Seq library. However, the verson on Nuget (as of this writing) takes a dependency on NLog 3.2. RavenDB 2.5 comes with NLog 2.0. My attempts at assembly binding redirects failed.

So, I copied (borrowed / stole / whatever) the code from the Seq NLog client. I then referenced the NLog binary that comes with Raven in my shiny new Raven.Seq.Client.NLog assembly and built.

After compiling, I placed the following dlls from my output directory in Raven.Server folder


I then added a shiny new nlog.config file.

My nlog.config (or at least as it pertains to Seq) looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns=""

<add assembly="Raven.Seq.Client.NLog"/>
<target name="seq" type="Seq" serverUrl="http://localhost:5341/">
<property name="Server" value="${machinename}" />
<property name="database" value="${mdc:item=database}"/>
<logger name="Raven.*" minlevel="Warn" writeTo="seq" />

And here you can see it in action:

raven images in seq