I've seen a lot of sample configurations of NLog. I noticed that some of the loggers specified the target by using the appendTo
attribute while others used the writeTo
attribute.
I could not find any documentation explaining when to use one over the other. And I couldn't spot any obvious pattern.
I thought maybe it depended on the type of target, whether it was a file or console or something. But I've seen it use interchangeably in both cases.
For example in this StackOverflow thread you can see the examples all use writeTo
exclusively:
Most useful NLog configurations
The second answer though uses appendTo
.
This other question includes one of each in it's sample code:
How to get NLog to write to database
Are they interchangeable? Aliases for each other? Or are there specific cases when do use which?