嵌入式RavenDB登录调试输出

时间:2013-01-15 08:54:51

标签: vb.net ravendb

我目前正在调查RavenDB并设置这个简单的测试

<TestFixtureSetUp()>
Public Sub Setup()
    _embeddableDocumentStore = New EmbeddableDocumentStore With {.DataDirectory = "localdatabase"}
    _embeddableDocumentStore.Initialize()

End Sub

<Test> Public Sub CreateDB()
    Dim session = _embeddableDocumentStore.OpenSession()
    Dim results = session.Query(Of testclass)().ToList()

    For Each testclass In results
        session.Delete(testclass)
    Next
    session.SaveChanges()

    session.Store(New testclass With {.Id = 4, .Name = "177mdffarsdfdffds6t2in611"})
    session.Store(New testclass With {.Id = 2, .Name = "17fd7martrsdfdffds6t2in611"})
    session.Store(New testclass With {.Id = 3, .Name = "re177marsdfdfffdfds6t2in611"})
    session.SaveChanges()

    results = session.Query(Of testclass)().ToList()

    For Each testclass In results
        session.Delete(testclass)
    Next
    session.SaveChanges()        
    results = session.Query(Of testclass)().ToList()

    Assert.AreEqual(0, results.Count())
End Sub

<TestFixtureTearDown()>
Public Sub TearDown()
    _embeddableDocumentStore.Dispose()
    _embeddableDocumentStore = Nothing
End Sub

但是我可以让嵌入式RavenDB数据库将调试信息写入visual studio Debug Output吗?我尝试在bin \ debug文件夹中添加一个带有此内容的nlog.config,但是当我调试时,我得不到输出中的查询信息......我做错了什么?

<nlog xmlns="http://www.nlog-project.org/schemas/NLog.netfx35.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <targets>
    <target xsi:type="Console" Name="Console" />
  </targets>
  <rules>
    <logger name="Raven.Client.*" writeTo="Console"/>
  </rules>
</nlog>

0 个答案:

没有答案