You're getting confused with Appenders and Loggers. A log itself can have multiple appenders (e.g. you could have an SmtpAppender and a FileAppender for an error log, but you may want a separate FileAppender for normal messages). Since you only configure the root logger, using <root>...
, then that is the only log that is ever returned using LogManager.GetLogger
, which in your configuration has both FileAppenders.
To configure multiple, separate logs, use <logger
tags, and then specify the appenders for each log:
<logger name="ErrorLog">
<level value="INFO" />
<appender-ref ref="ErrorLog" />
</logger>
<logger name="PayWinSrvLog">
<level value="INFO" />
<appender-ref ref="PayWinSrvLog" />
</logger>