1

Is it possible to define two separate loggers each with its dedicated file handler 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.

Cœur
  • 37,241
  • 25
  • 195
  • 267
SmoothCriminel
  • 367
  • 1
  • 7
  • 17

1 Answers1

1

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

Community
  • 1
  • 1
Lithium
  • 5,102
  • 2
  • 22
  • 34