From: <ke...@us...> - 2004-11-30 00:54:05
|
>> This is my problem: >> >> log4j:WARN No appenders could be found for logger >> (ca.uhn.hl7v2.app.MessageTypeRouter). >> log4j:WARN Please initialize the log4j system properly. >> >> I have tried many things to get logging to work. My gut tells me that the >> logging system is not reading the log4j.xml file though. In a directory, >> I >> have the hapi-0.4.2.jar as well as log4j.xml -- the other jars are located >> in the directory "lib". When I execute the hapi.jar, I am not getting any >> log file like I expect. Anyone else have any suggestions? I feel like I >> am >> overlooking a very simple item. > >Try setting the log4j.debug property on the command line for your >application using the JVM -D option. This will give you more information >about where log4j is looking for the file. > >Almost certainly your classpath isn't including the path to the log4j.xml. >Try adding the directory containing your log4j.xml file to your classpath. Yes, add something like this to your java options or properties: -Dlog4j.configuration=file:///opt/hapi/conf/log4j.xml It took me some time reading the "wonderful" log4j documentation to understand this. |