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
精彩评论