To use the names you want you can make 3 loggers:
private static readonly log4net.ILog logError = log4net.LogManager.GetLogger("ErrorAppender");
private static readonly log4net.ILog logResponse = log4net.LogManager.GetLogger("ResponseAppender");
private static readonly log4net.ILog logRequest = log4net.LogManager.GetLogger("RequestAppender");
When logging a log message you have to use the correct logger. Your appenders are configured to handle each logger in a seperate file.
The problem with your current code is the:
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType
Because you use static logger the loggers names can probably not formed correctly. There is no System.Reflection.MethodBase.GetCurrentMethod()
because when the static initalize is called there is not GetCurrentMethod
. You can change that to typeof(..).Name
. However you appenders need to be reconfigured to log your classnames.