Why is Logger.isInfoEnabled deprecated for org.jboss.logging.Logger?

I have not been able to use Log4J for several years. Now I am working on an application in JBoss 5 using the org.jboss.logging package. Back when I did this, it was a common method to attach logger.info () messages inside a logging level check. This avoided the relatively expensive work of creating an informational message if it was thrown away anyway. Here is an example:

if (logger.isInfoEnabled()) { logger.info("AddRedemption response: \"" + redemptionResponse.getResponseString() + "\""); } 

But now I found that my reliable IDE is warning me that isInfoEnabled is out of date. This is directly related to my two questions:

  • Why is this out of date?
  • What should be used instead?

Thanks in advance for your help.

-Mark

+4
source share
1 answer

As stated in the commentary, the JBoss Logger INFO logging level is used to record low volume information. It is not mentioned that the INFO logging level was always printed on the console (screen), therefore there was no logged file that captured the INFO level. It was wise to abandon it, because developers do not need it.

There's an interesting Dimitris Andreadi blog about a certain level of JBoss logging.

+3
source

All Articles