Log4net: separate log files for each class

后端 未结 1 1788
清歌不尽
清歌不尽 2021-02-09 01:41

i want to log messages from multiple classes. the problem is that currently i can log all messages into single file.i want to do this class A should log its messages into ALog.t

1条回答
  •  情歌与酒
    2021-02-09 01:43

    In addition to the root logger, you can configure individual loggers with their own appenders. Assuming you are calling your loggers ClassA and ClassB you can do:

    
         
    
    
         
    
    
         
    
    

    This is further described here.

    0 讨论(0)
提交回复
热议问题