RavenDB version 2.5. Other versions:

Enabling debug logging for Raven

Raven has extensive support for debug logging, enabling you to figure out exactly what is going on in the server. By default, logging is turned off but you can enable it at any time by creating a file called "NLog.config" in Raven's base directory with the following content:

    <nlog xmlns="http://www.nlog-project.org/schemas/NLog.netfx35.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
			<target xsi:type="SplitGroup">
			<target name="File" xsi:type="File"
			<layout xsi:type="CsvLayout">
			<column name="time" layout="${longdate}" />
			<column name="logger" layout="${logger}"/>
			<column name="level" layout="${level}"/>
			<column name="message" layout="${message}" />
			<column name="exception" layout="${exception:format=tostring}" />
			<logger name="Raven.*" writeTo="AsyncLog"/>
Comments add new comment

The comments section is for user feedback or community content. If you seek assistance or have any questions, please post them at our support forums.

Charlie B
REPLY Posted by Charlie B on

For build #2700 the NLog.config file must be placed in the \Server folder and the service must be restarted before logs will start being written.

Andy Brown
REPLY Posted by Andy Brown on

Running the embedded version of RavenDB (2.5.2750) I got no results after adding an NLog.config to my base directory.

Eventually, I added the NLog NuGet package to my project (my application uses Log4Net, not NLog) and then logs were written