[jboss-user] [Beginners Corner] - Warning when use log4j

changemylife do-not-reply at jboss.com
Fri Sep 7 05:08:52 EDT 2007

Hi all!
  I begginer with Log4j, and I have a problem that I need help:
  I use:
  anonymous wrote : jboss-4.0.5.GA, EJB3.0
  I have a bean (called RecordBean):
  anonymous wrote : ...
  | private static final Logger myLogger = Logger.getLogger(RecordBean.class);
  | 	public void add(int num1, int num2) {
  | 		myLogger.info("Perform the adding two numbers...");
  |                 ...
  | 	}
   And inside anonymous wrote : \server\default\conf, I edit file log4j.xml (add my definition):
   <appender name="XXX" class="org.apache.log4j.FileAppender">
  |       <param name="File" value="${jboss.server.log.dir}/mylog.log"/>
  |       <param name="Threshold" value="INFO"/>
  |           <layout class="org.apache.log4j.PatternLayout">
  |       <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
  |       </layout>
  |    </appender>
  | .....
  |    <logger name="bean.log">
  |         <appender-ref ref="QT"/>
  |    </logger>
  |    <root>
  |       <appender-ref ref="CONSOLE"/>
  |       <appender-ref ref="FILE"/>
  |    </root>
   But when I deploy RecordBean, and my client call add method, logging ok, but I receive some Warning:
anonymous wrote : log4j:WARN No appenders could be found for logger (org.jboss.security.SecurityAssociation).
  | log4j:WARN Please initialize the log4j system properly.
  I imported log4j.jar.
  Please help me to solve this problem.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082008#4082008

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082008

More information about the jboss-user mailing list