开发者

Specify multiple loggers with multiple handlers for one class in java.util.logging

开发者 https://www.devze.com 2023-02-15 20:18 出处:网络
Is it possible to define two separate loggers each with its dedicated file 开发者_如何学Chandler for one class using java.util.logging? I want separate log file for errors and other application messag

Is it possible to define two separate loggers each with its dedicated file 开发者_如何学Chandler for one class using java.util.logging? I want separate log file for errors and other application messages. I am trying but no success so far.

Can anyone suggest what is the possible solution for this? I am initializing one logger at the start of application which reads configurations from logging.properties and creating other logger within one function of the class.


I know log4j can allow you to send messages with different thresholds (errors or application messages) to seperate files. Perhaps you could look into that.

Take a look at How to configure log4j to log different log levels to different files for the same logger

0

精彩评论

暂无评论...
验证码 换一张
取 消