When you have 2 appenders, say one for debug errors and one for product errors, in your code, do you explicitly create 2 log classes or is an appender basically going to write any log messages that meet a certain criteria?
So in your code, you use a single log method, and depending on how your appenders are setup, it will log the message if it e.g. is logged from a specific namespace, or is a certain log level.
So its possible a single log entry is written to 2 log files?
Yes, you can have single log statements post to multiple appenders. As long as it meets the criteria for each, it will use each appender.
For example, take this config section, it logs all messages to file, and also logs warnings and errors to event viewer.:
So this:
Will only appear in the log file (because it doesn’t meet the event log appender’s filter criteria).
But this:
Will log to both the log file and the event viewer.
UPDATE: On your filtering question, if you had:
Then all things under Com.Foo will log if WARN or higher, but everything else would log at DEBUG or higher….