SemanticComputing / fuseki-docker

Apache Jena Fuseki with SeCo extensions
MIT License
33 stars 14 forks source link

Enable logging #2

Closed GTP95 closed 1 year ago

GTP95 commented 5 years ago

Hello, I've a docker container running your image and since I'm trying to add a reasoner to Fuseki (specifically openllt but actually I don't really care which reasoner I use as long as it works) but I'm not sure if I'm doing things right it would help me to have logs with warnings/errors. As stated in the fuseki documentation I've added the default log4j.properties in the fuseki-base directory, but after restarting the container the logs folder is still empty. Do I have to add slj4j/Apache log4j to the classpath to get logs or have I to do something else? Thanks for your help

yoge1 commented 1 year ago

Apologies for not returning to this earlier.

Fuseki's logging configuration has changed during the years, but with the current version (4.7.0) I was able to make Fuseki to log into a file with the following steps:

  1. Modify the default Fuseki log4j2.properties by adding the file logger configuration.
  2. Copy the modified file to /jena-fuseki/log4j2.properties
  3. (Re)start the container.

Now Fuseki logs into /fuseki-base/logs/app.log.

Here's the configuration I added into log4j2.properties:

property.basePath = /fuseki-base/logs

# RollingFileAppender name, pattern, path and rollover policy
appender.rolling.type = RollingFile
appender.rolling.name = fileLogger
appender.rolling.fileName= ${basePath}/app.log
appender.rolling.filePattern= ${basePath}/app_%d{yyyyMMdd}.log.gz
appender.rolling.layout.type = PatternLayout
appender.rolling.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} %level [%t] [%l] - %msg%n
appender.rolling.policies.type = Policies

rootLogger.appenderRef.rolling.ref = fileLogger