Writing multiple log files with Log4Net using Microsoft.Extensions.Logging.Abstractions

259 Views Asked by At

I have successfully set up logging in my app using Microsoft.Extensions and Log4Net. But what I cannot do is log different information to different log files. With Log4Net natively, I can simply set up two rollingFileAppenders and call LogManager and pass in the name of the RollingFileAppender to which I wish to log. There doesn't seem to be an equivalent using Microsoft.Extensions.Logging.Abstractions even though of course I'm using Log4Net in both places. As far as I can tell, the logger must be choosing the first instance of the RollingFileAppender and using those settings. Has anyone else resolved this problem?

0

There are 0 best solutions below