Enabling RavenDB logging?

1,572 views
Skip to first unread message

BAM

unread,
Mar 6, 2012, 10:19:32 AM3/6/12
to ravendb
I'm using build 701 which I just deployed to replace last stable
(616?).

The Logs screen shows this message:

Logs end point is not enabled.
To enable it, add a file called 'NLog.config' in the same directory
as the server, with the following content:

Then there is an empty box where, I assume, the "following content" is
supposed to be.

Searches on this turned up some old threads indicating this was a
problem, but had been fixed. Is it an old bug re-surfacing or am I
doing something wrong?

I do have an NLog.xml and NLog.dll in bin under the Raven root. I
tried cp NLog.xml NLog.config. Didn't do anything.

FYI - My old build was never showed any log records. (It was on my
list to get that set up, but...) However it did not show the message
above just never logged anything.

Thanks in advance,

B.

Oren Eini (Ayende Rahien)

unread,
Mar 6, 2012, 12:15:40 PM3/6/12
to rav...@googlegroups.com
A known issue which will be fixed in a few days:

BAM

unread,
Mar 6, 2012, 1:05:52 PM3/6/12
to ravendb
Thanks.

Is there a way I can enable logging?

Reading through the configuration values on the Raven site it seems
like it is on by default. But as far as I can see there isn't anything
definitive there.

On Mar 6, 12:15 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:

Oren Eini (Ayende Rahien)

unread,
Mar 6, 2012, 1:08:47 PM3/6/12
to rav...@googlegroups.com
Put this in a NLog.config next to the server .config file.

<targets>
<target 
xsi:type="AsyncWrapper"
name="AsyncLog">

<target xsi:type="SplitGroup">
<target xsi:type="HttpEndpoint" />
<target name="File" xsi:type="File"
fileName="${basedir}\Logs\${shortdate}.log">
<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}" />
</layout>
</target>
</target>
</target>

<target xsi:type="ColoredConsole"
name="Colored-Console"
useDefaultRowHighlightingRules="true"
layout="${message} ${exception}"/>
</targets>
<rules>
<logger name="Raven.Database.Server.HttpServer" writeTo="Colored-Console"/>
    <logger name="Raven.Database.Indexing.IndexStorage.Startup" level="Warn" writeTo="Colored-Console"/>
<logger name="Raven.*" writeTo="AsyncLog"/>
</rules>
</nlog>

BAM

unread,
Mar 6, 2012, 6:51:29 PM3/6/12
to ravendb
Oren,

Thanks for the reply. I think I may have not given you enough
information. I am running an IIS instance. I don't have a
server .config file.

I put the contents you provided in file called NLog.config and placed
a copy in the root and the bin file under the root. For good measure I
restarted the server. No change in the studio view. I do though now
seem to have a logfile in the logs directory.

Is there something else I need to do?

Thanks,

B.

On Mar 6, 1:08 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:

Justin A

unread,
Mar 6, 2012, 7:25:05 PM3/6/12
to rav...@googlegroups.com
Bam, do you know where the Raven.Server.exe file is located? 

when you do, create a file called nlog.config in the same directory (aka side by side) to the Raven.Server.exe.

BAM

unread,
Mar 7, 2012, 9:39:45 AM3/7/12
to ravendb
Justin,

The Raven.Server.exe is in the bin directory referenced in my reply to
Oren. There is a copy there. I still see the "end point not enabled"
message in studio. There are, however, log files. And in the studio I
can see active counts (upper left "Logs (## entries)"). No log
information other than the count is displayed in studio.

B.

legion

unread,
Mar 7, 2012, 10:19:28 AM3/7/12
to rav...@googlegroups.com


I have the same issue after adding nlog.config to my IIS instance. However i did notice that it indicates there are 69 entries.

BAM

unread,
Mar 7, 2012, 10:38:54 AM3/7/12
to ravendb
Yes, that's what I meant by the active count.

On Mar 7, 10:19 am, legion <hassanfmi...@gmail.com> wrote:
> <https://lh6.googleusercontent.com/-ryUq5Y33GlM/T1d8TR5t4hI/AAAAAAAAAB...>

BAM

unread,
Mar 9, 2012, 4:03:13 PM3/9/12
to ravendb
legion,

Has anyone given you an answer? I can see the logs if I remote into
the server. But so far studio will only display the count.

Anyone?

B.

Nick Hird

unread,
Mar 13, 2012, 5:04:23 PM3/13/12
to rav...@googlegroups.com
I just got the correct NLog.config file in the Server directory and it doesnt show the logs but the counter is running and quite fast so i am guessting something is being thrown to the log file based on the logging being broken somehow. I also installed this same version on my Windows 8 machine and copied over the same config file and everything works fine. It shows the log and only has a few entries. So i removed the file on my Windows 7 box until its fixed. I just wanted to let you know it seems to work fine on Windows 8 for some reason but not Windows 7. Not sure why...  

Oren Eini (Ayende Rahien)

unread,
Mar 13, 2012, 5:22:12 PM3/13/12
to rav...@googlegroups.com
It is possible that this is an SL5 issue, can you check build 707?

BAM

unread,
Mar 14, 2012, 10:14:59 AM3/14/12
to ravendb
I am seeing the same counter but no logs, and am not running SL5, but
4.0.60831.0

On Mar 13, 5:22 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:

Nick Hird

unread,
Mar 15, 2012, 9:27:40 AM3/15/12
to rav...@googlegroups.com
I just got the newer 712 and it shows the counter but doesnt show any log. At least before it showed a box where the log file would display, now it doesnt even show that.
I am running SL5 on Windows 7 64.

On Tuesday, March 13, 2012 5:22:12 PM UTC-4, Oren Eini wrote:
It is possible that this is an SL5 issue, can you check build 707?

Nick Hird

unread,
Mar 15, 2012, 10:02:13 AM3/15/12
to rav...@googlegroups.com
On top of that, IE keeps crashing whenever i keep the studio open for more then a few minutes on any tab except the summary. I know its unstable...

Oren Eini (Ayende Rahien)

unread,
Mar 15, 2012, 10:07:36 AM3/15/12
to rav...@googlegroups.com
Yes, we just found out about this.
Fixed in a local build, and will be out soon.

Unstable is unstable :-)

If it helps, 712 is now running our production systems. The UI has a problem (NRE in a background thread causing a crash), but the rest seems to be working just fine.

aaron navaro

unread,
Mar 29, 2012, 3:34:42 AM3/29/12
to rav...@googlegroups.com
I am using the config listed above and version 701.
The error I get is below, am I supposed to be replacing the 'HttpEndpoint' text with a url or something? :

Server Error in '/' Application.

Target cannot be found: 'HttpEndpoint'

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Target cannot be found: 'HttpEndpoint'

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentException: Target cannot be found: 'HttpEndpoint']
   NLog.Config.Factory`2.CreateInstance(String name) in c:\NLogBuild\src\NLog\Config\Factory.cs:200
   NLog.Config.XmlLoggingConfiguration.ParseTargetElement(Target target, NLogXmlElement targetElement) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs:585
   NLog.Config.XmlLoggingConfiguration.ParseTargetElement(Target target, NLogXmlElement targetElement) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs:624
   NLog.Config.XmlLoggingConfiguration.ParseTargetsElement(NLogXmlElement targetsElement) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs:538
   NLog.Config.XmlLoggingConfiguration.ParseNLogElement(NLogXmlElement nlogElement, String baseDirectory) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs:344
   NLog.Config.XmlLoggingConfiguration.Initialize(XmlReader reader, String fileName, Boolean ignoreErrors) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs:247

[NLogConfigurationException: Exception occurred when loading configuration from D:\RavenDB-Build-573\Web\NLog.config]
   NLog.Config.XmlLoggingConfiguration.Initialize(XmlReader reader, String fileName, Boolean ignoreErrors) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs:264
   NLog.Config.XmlLoggingConfiguration..ctor(String fileName) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs:72
   NLog.LogFactory.get_Configuration() in c:\NLogBuild\src\NLog\LogFactory.cs:148
   NLog.LogFactory.GetLogger(LoggerCacheKey cacheKey) in c:\NLogBuild\src\NLog\LogFactory.cs:717
   NLog.LogManager.GetCurrentClassLogger() in c:\NLogBuild\src\NLog\LogManager.cs:143
   Raven.Database.Util.PortUtil..cctor() in c:\Builds\raven\Raven.Database\Util\PortUtil.cs:9

[TypeInitializationException: The type initializer for 'Raven.Database.Util.PortUtil' threw an exception.]
   Raven.Database.Util.PortUtil.GetPort(String portStr) in c:\Builds\raven\Raven.Database\Util\PortUtil.cs:30
   Raven.Database.Config.InMemoryRavenConfiguration.Initialize() in c:\Builds\raven\Raven.Database\Config\InMemoryRavenConfiguration.cs:121
   Raven.Database.Config.RavenConfiguration.LoadConfigurationAndInitialize(IEnumerable`1 values) in c:\Builds\raven\Raven.Database\Config\RavenConfiguration.cs:30
   Raven.Database.Config.RavenConfiguration..ctor() in c:\Builds\raven\Raven.Database\Config\RavenConfiguration.cs:19
   Raven.Web.ForwardToRavenRespondersFactory.Init() in c:\Builds\raven\Raven.Web\ForwardToRavenRespondersFactory.cs:65
   Raven.Web.RavenDbStartupAndShutdownModule.<Init>b__0(Object sender, EventArgs args) in c:\Builds\raven\Raven.Web\BootStrapper.cs:12
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +266


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225

Oren Eini (Ayende Rahien)

unread,
Mar 29, 2012, 3:41:12 AM3/29/12
to rav...@googlegroups.com
Aaron,
How did you get this error?
Are you SURE you are using 701?

In the BootStrapper code, we have a call to HttpEndpointRegistration.RegisterHttpEndpointTarget();
Which register the HttpEndpoint target.

Maverix

unread,
Dec 3, 2012, 1:26:32 AM12/3/12
to rav...@googlegroups.com
I am still seeing this exception when trying to activate logging in azure IIS hosted setup.

NLog.NLogConfigurationException
       HResult=-2146233088
       Message=Exception occurred when loading configuration from F:\Projects\SLC\Database\SLC.AzureProject\csx\Release\roles\SLC.SupportRole\approot\bin\NLog.config
       Source=NLog
       StackTrace:
            at NLog.Config.XmlLoggingConfiguration.Initialize(XmlReader reader, String fileName, Boolean ignoreErrors)
            at NLog.Config.XmlLoggingConfiguration..ctor(String fileName)
            at NLog.LogFactory.get_Configuration()
            at NLog.LogFactory.GetLogger(LoggerCacheKey cacheKey)
            at NLog.LogFactory.GetLogger(String name)
            at NLog.LogManager.GetCurrentClassLogger()
            at Raven.Web.Base.Helpers.CloudIISConfiguration..cctor() in f:\Projects\SLC\Database\Raven.Web.Base\Helpers\CloudIISConfiguration.cs:line 11
       InnerException: System.ArgumentException
            HResult=-2147024809
            Message=Target cannot be found: 'HttpEndpoint'
            Source=NLog
            StackTrace:
                 at NLog.Config.Factory`2.CreateInstance(String name)
                 at NLog.Config.XmlLoggingConfiguration.ParseTargetsElement(NLogXmlElement targetsElement)
                 at NLog.Config.XmlLoggingConfiguration.ParseNLogElement(NLogXmlElement nlogElement, String baseDirectory)
                 at NLog.Config.XmlLoggingConfiguration.ParseTopLevel(NLogXmlElement content, String baseDirectory)
                 at NLog.Config.XmlLoggingConfiguration.Initialize(XmlReader reader, String fileName, Boolean ignoreErrors)
            InnerException: 

Maverix

unread,
Dec 3, 2012, 1:27:06 AM12/3/12
to rav...@googlegroups.com
Using BUILD 960

Maverix

unread,
Dec 3, 2012, 2:05:33 AM12/3/12
to rav...@googlegroups.com
Fixed by adding HttpEndpointRegistration.RegisterHttpEndpointTarget(); in the OnStart() of the EntryRole
It was being called in the BootStrapper.Init(); i'm not sure why this wasn't working

On Monday, 3 December 2012 16:57:06 UTC+10:30, Maverix wrote:
Using BUILD 960

Oren Eini (Ayende Rahien)

unread,
Feb 10, 2013, 4:04:36 AM2/10/13
to ravendb
There is no console logging when running as service, since there is no console.

You can enable debug logging using the specified approach : http://ravendb.net/docs/server/deployment/docs-debug-logging


On Fri, Feb 8, 2013 at 10:36 PM, Ben , Bashkan <qba...@gmail.com> wrote:
Hi,
when start up as windows service,how to config or start the console logging on ravendb? 
thanks

--
You received this message because you are subscribed to the Google Groups "ravendb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages