Thanks for the reply. That's great news!
I have created a simple WebService to test this that goes something like this:
Imports NLog
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
<System.Web.Services.WebService(Namespace:="
http://tempuri.org/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class test
Inherits System.Web.Services.WebService
Private Shared logger As Logger = LogManager.GetCurrentClassLogger()
<WebMethod()> _
Public Function TestXML(ByVal request As String) As String
Try
logger.Debug("XML Received : " & request)
Dim testMe As New XMLSchemaValidator
logger.Debug("Testing XML 1.")
Return testMe.ValidateXML(request)
Catch ex As Exception
logger.DebugException("Oh dear! ", ex)
Finally
logger.Debug("Testing XML 2")
End Try
End Function
End Class
What can I do so that I can reference the same instance of NLog in my other classes e.g. XMLSchemaValidator
Testing this as it is appears to just create one instance of logger and reuse it over and over again...
I think for this to work I would need it to create a new instance of "Logger" every time the WebMethod is called...?