NLog: WebService target not being written to

I incorporated NLOG to a couple of my projects and have never had any trouble writing either to the file or database target types. I recently decided to implement a web wervice target. It doesn’t work. Here’s a sample of the pertinent config lines :

<target xsi:type="WebService" name="ws" namespace="" methodName="" protocol="HttpPost" url="https://myserver/mywebapi/errorlog">
<logger name="MyApp.Handlers.LoggingHandler" minlevel="Warn" writeTo="ws" />

the logging call that works when using a file target…

private static Logger logger = LogManager.GetCurrentClassLogger();

...

            logger.Error("{0:yyyy-MM-dd HH:mm} {1} {2} {3}", DateTime.Now, GetUsername(context), context.Exception.TargetSite, (builder.ToString().Length > 500) ? builder.ToString().Substring(0, 500) : builder.ToString());
        }

I traced using fiddler, but could not see the web method being called.
I am currently using version 3.2.0.0 of NLOG with asp.net 4.5 with mvc 5.2.2.0.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 22 (14 by maintainers)

Most upvoted comments

@nfriacowboy Please delete your comment and create new issue. No reason to wake old giants. See https://github.com/NLog/NLog/issues/new/choose