Log4J configuration missing?
rpgoldman opened this issue · 8 comments
Trying to start Owlery from the Docker container I get the following warning, because of a missing or incorrect log4j
configuration. I did read the FAQ the error cites but ... it is not at all helpful. In particular, it says
Knowing the appropriate location to place log4j.properties or log4j.xml requires understanding the search strategy of the class loader in use.
A little googling suggests that I might need to put something in the akka
configuration, but I am not sure what. But I'm not sure that is right, since the error message just mentions jena.
docker run --rm -p 8080:8080 -v /Users/rpg/projects/xplan/container-ontology/owl/:/srv/owl -v /Users/rpg/projects/xplan/container-ontology/owl/owlery-conf:/srv/config phenoscape/owlery:latest
log4j:WARN No appenders could be found for logger (org.apache.jena.util.FileManager).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
@balhoff Assuming you use OWLAPI in Owlery, is there some way I can configure Log4j so that I can see messages from OWLAPI?
Hoping this will help: owlcs/owlapi#1015
Thanks! We may need to include a log4j implementation. I will come back to this after a couple of the other issues. I have some unrelated tasks slowing me down here.
@balhoff I just looked at /usr/share/owlery/bin/owlery
, and it looks like there is a log4j implementation included in Owlery's classpath: $lib_dir/log4j.log4j-1.2.17.jar
.
And I checked and the jar file is there in the Docker image.
Trying to follow the suggestion here, I ran the docker image as follows, but adding the default log level flag has had no visible effect:
docker run --rm --env JAVA_OPTS=-Dorg.slf4j.simpleLogger.defaultLogLevel=DEBUG -p 8080:8080 -v /Users/rpg/projects/xplan/container-ontology/owl//server-files:/srv/owl -v /Users/rpg/projects/xplan/container-ontology/owl/owlery-conf:/srv/conf owlery:latest
When I run a bash shell inside the container I see that JAVA_OPTS
is bound, so I assume that Java is seeing it, it's just not having an effect, possibly because of the log4j configuration issue. Will experiment more.
I should correct the above: it does seem to work to the extent that this removes the log4j warning method. But ... I am still not seeing any log entries out of OWLAPI. So perhaps I need to be doing something to redirect the logging for OWLAPI to a different location. Maybe setting a handler? AFAICT from reading the docs, sl4fj should be defaulting to a handler that will write to standard output, but I still only see output from the akka
logger; nothing from OWLAPI. Possibly the server doesn't have standard output in the way I expect it would?
I wish the Java logging infrastructure wasn't so complicated...
That's great, thanks for your perseverance. A lot of things are in better shape as a result.
The thanks are all due to you, for fixing things so quickly!