Apache Log4j- Priority.WARN is deprecated - what to use instead?
Apache Log4j- Priority.WARN is deprecated - what to use instead?
I am trying to log a message with Apache Log4j
.
I was used to set the priority-level by using Priority.[level]
Apache Log4j
Priority.[level]
Example:
Logger log = Logger.getLogger(MyClass.class);
log.log(Priority.INFO, "Message")
My IDE now told me that Priority.INFO
is deprecated. What should be used now instead of it (By still using log4j
).
Priority.INFO
log4j
1 Answer
1
As explained in the Javadoc: https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Priority.html , use Level class instead.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.