Friday 15 July 2011

log4j not showing info on the console -


I am new to log4j and am trying to use it in a project. For some reasons the information will not be displayed on the console. It only works when I change it to logger.error (). This is only happening in the user service impulse class. Other controllers like classes are fine, this is log4j.xml:

   & Lt; / Layout & gt; & Lt; / Appender & gt; & Lt ;! - The root logger system sends all the log statements except for all those sent to the perf4j logger to log in. - & gt; & Lt; Root & gt; & Lt; Level value = "ERROR" /> & Lt; Epander-reef ref = "console" /> & Lt; / Root & gt; & Lt; Logger name = "com.click.heal.controller" additivity = "false" & gt; & Lt; Level value = "INFO" /> & Lt; Epander-reef ref = "console" /> & Lt; / Logger & gt; & Lt; Logger name = "com.click.heal.service" additivity = "true" & gt; & Lt; Level value = "INFO" /> & Lt; Epander-reef ref = "console" /> & Lt; / Logger & gt; & Lt; / Log4j: Configuration & gt;    

Your original range is at the ERROR level, something that does not fall under your second two logger It will come under the root, and will only enter the error level. If you change your root level to INFO, then I'm sure it logs, does not it? It is not saying what you want, but it is a clue that your UserServiceImpl class is just logging under the root.

EDIT

Wrong on your logger for the service package. Connector means that the message is proposed for parents, and since parents have root and root log in the same console appender, it seems that this is causing the problem.

No comments:

Post a Comment