2
votes

In an NLog.config file I had to add a new rule to log errors to the event log.

There was already a line specifying an error target:

<logger name="*" minlevel="Error" writeTo="AzureTableStorage" />

So I just added eventlog to the writeTo parameter.

<logger name="*" minlevel="Error" writeTo="AzureTableStorage,eventlog" />

And here is eventlog

<target xsi:type="EventLog"
    name="eventlog"
    source="MyApp"
    layout="${message}${newline}${exception:format=ToString}"/>

However some of the other targets (AzureTableStorage, trace, loggly) all have a blue underline on them and the tooltip says

This is an invalid xsi:type http://www.nlog-project.org/schemas/NLog.trace

In another project the same targets do not have this error.

What do I need to do to remove this error?

1

1 Answers

1
votes

This is a error from the XSD, which should be seen as warning. The XSD is generated with all the possible targets (in the NLog main package) and thus doesn't have the custom targets.

These kind of errors could be ignored and NLog won't stop working if the XML config contains these kind of "errors".