Skip to content

Error or Debugging messages in VERDI

lizadams edited this page Sep 10, 2015 · 2 revisions

VERDI code has been changed to consistently use the log4j logger. You can control the level of output generated by the logger by editing the log4j2.xml file to specify DEBUG or WARN ./plugins/bootstrap/lib/log4j2.xml

For more information please see this help guide: http://www.tutorialspoint.com/log4j/log4j_quick_guide.htm

I am also getting a warning when I use eclipse on the chome book: log4j: WARN No appenders could be found for logger (org.eclipse.jgit.util.FS) log4j: WARN Please initialize the log4j system properly

I added a log4.properties file with the following contents: #Define the root logger with appender file log4j.rootLogger = Debug, File

#Define the file appender log4j.appender.FILE=org.apache.log4j.FileAppender

#Set the name of the file log4j.appender.FILE.File=/home/lizadams/verdi/log4j.log.out

This took care of the warning messages, but nothing was written to that log file from VERDI, the messages that VERDI sent went to /home/lizadams/verdi/verdi.log

In VERDI, I am now having a problem with a ClassDefNotFound error Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Priority at simphony.util.messages.MessageCenter.getMessageCenter (MessageCenter.java: 66) at simphony.util.messages.MessageCenter.getMessageCenter (MessageCenter.java: 44) at simphony.util.messages.MessageCenter.getMessageCenter (MessageCenter.java: 26) at saf.core.runtime.Boot Boot.java:50

I downloaded a new log4j-core-2.3.jar file and used jar to examine it's contents: jar tf log4j-core-2.3.jar | grep Priority org/apache/logging/log4j/core/net/Priority.class

Note, to find the MessageCenter.java file I use the following linux command under the /home/lizadams/git/VERDI directory: find . -name MessageCenter.java -print result: ./verdi_saf_core_runtime/src/simphony/util/messages/MessageCenter.java This file has at the top a statement to import org.apache.log4j.Level

I checked the log4j-api-2.3.jar to see where the Level class was and found: jar tf log4j-api-2.3.jar | grep Level org/apache/logging/log4j/Level.class

Does it make a difference that the level class is in the api jar file while the Priority class is in the core jar ??

Clone this wiki locally