Skip to content

Missing documentation on rules for NLog.config #3377

@mindisk

Description

@mindisk

I was looking at how to configure logger rules in NLog.config. I wanted to add a name (identifier) to rule. I tried following Rules section and I got confused about how to assign this name to a rule.
After digging through the code I found a property named RuleName. It was not clear from the wiki how this property is assign using <logger> tag. I found out that this tag does not support such attribute. You need to use <rule> tag within <rules> . There was no information in the wiki about this <rule> tag and difference between it and the <logger> tag.

Example:
<logger name="*" minlevel="Info" writeTo="defaultlogfile" />
<rule name="defaultlogfile" logger="*" minlevel="Info" writeTo="defaultlogfile"/>

I am not sure if these two tags can be used simultaneously pointing to different targets.

All in all, I would ask to update the wiki about <rule> tag and the difference between it and the <logger> (if this information is not located in some other place already).

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions