Reputation: 861
How can I configure logging folder path by specified exception using log4net ?
I wanna specify logging folder at exception level, not at Appender level. Something like that : "_log.Error(exception, {LogFolder});"
Upvotes: 2
Views: 102
Reputation: 14962
It won't be really doable unless you write a custom appender for it. This appender could work on context variables to retrieve the desired folder: in this case you would need to use an event context
Another way would be to create as many appenders as needed for exceptions you're interested in and filter each appender by an exception. For that you would need to create a custom filter based on a FilterSkeleton
Upvotes: 1