I'd like to log some special events into a different table that will contain more data then the general application log.
If I add a second database target to the NLog.config
how can I use it in my code?
Would this be the right thing to do:
NLog
.LogManager
.Configuration
.AllTargets
.Single(x => x.Name == "mySecondLogTable")
.WriteAsyncLogEvent(...);
Then in the NLog.config
I would just skip this target in the rules element, right?
Summary: I'd like to define multiple database targets like a general log and specialized log for cases where I need to log more details into a different table. I'd like to use the general log by default and the special log only in functions that need this special kind of logging because of their business logic.