You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Andy Seaborne <an...@apache.org> on 2020/03/20 15:27:25 UTC

All :: Logging change

The logging changes have gone into master.

Snapshot artifact rebuilt.
The remaining item is JENA-1867.

If you are updating your local copy of Jena source,
getting rid of 3.15.0-SNAPSHOTs and rebuilding

In Eclipse, Alt-F5 (maven refresh) at the top should work (hard for me 
to test as my machine is contaminated) but a clear-up /rebuild is safer.

For applications that used slf4j and log4j1:

To get log4j2 you need one artifact (not the two as was needed for log4j1)

     <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-slf4j-impl</artifactId>
       <version>2.13.0</version>
     </dependency>

This is the bridge from slf4j and also pulls in the necessary log4j2 
dependencies.

An example log4j2.properties is below and at the gist:
https://gist.github.com/afs/237f682a3698381569cbe9181e223e4b

Put in e.g. src/main/resources

In LogCtl:

LogCtl.setLog4j - does not work - it complains.
Use LogCtl.setLog4j2
because the properties format must be changed.

LogCtl.setCmdLogging() works.

    Andy

==== Example lgo4j2.properties file:


## Licensed under the terms of
## http://www.apache.org/licenses/LICENSE-2.0
status = error
name = PropertiesConfig
filters = threshold

filter.threshold.type = ThresholdFilter
filter.threshold.level = INFO

appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{HH:mm:ss} %-5p %-15c{1} :: %m%n

rootLogger.level                  = INFO
rootLogger.appenderRef.stdout.ref = STDOUT

logger.jena.name  = org.apache.jena
logger.jena.level = INFO

logger.arq-exec.name  = org.apache.jena.arq.exec
logger.arq-exec.level = INFO

logger.riot.name  = org.apache.jena.riot
logger.riot.level = INFO

logger.fuseki.name  = org.apache.jena.fuseki
logger.fuseki.level = INFO

logger.fuseki-fuseki.name  = org.apache.jena.fuseki.Fuseki
logger.fuseki-fuseki.level = INFO

logger.fuseki-server.name  = org.apache.jena.fuseki.Server
logger.fuseki-server.level = INFO

logger.fuseki-admin.name  = org.apache.jena.fuseki.Admin
logger.fuseki-admin.level = INFO

logger.jetty.name  = org.eclipse.jetty
logger.jetty.level = WARN

# May be useful to turn up to DEBUG if debugging HTTP communication issues
logger.apache-http.name   = org.apache.http
logger.apache-http.level  = WARN

# This goes out in NCSA format
appender.plain.type = Console
appender.plain.name = PLAIN
appender.plain.layout.type = PatternLayout
appender.plain.layout.pattern = %m%n

logger.request-log.name   = org.apache.jena.fuseki.Request
logger.request-log.additivity             = false
logger.request-log.level                  = OFF
logger.request-log.appenderRef.plain.ref  = PLAIN