Skip to content

Logging

Configure logging

SLF4J is used with Log4j 2 as backend.

EntryStore 6.x logs to the standard output by default. Logging is configured with the Spring Boot logging settings, which can be set in entrystore.properties or on the command line, for example:

logging.level.org.entrystore=debug
logging.level.org.apache.solr=warn
logging.file.name=/var/log/entrystore/entrystore.log

A complete Log4j 2 configuration file can be used instead with logging.config=/path/to/log4j2.xml.

The configuration is done through log4j2.properties which is provided in the class path. Overriding is possible by providing an alternative configuration file.

Request logging (6.x)

EntryStore 6.x logs one line per request (method, URI, client IP address) and one line per response (status and duration) at level INFO. Query parameters are not logged. Request logging is switched off with:

logging.http.enabled=false

The client IP address is taken from the forwarded headers of the reverse proxy, see Reverse proxy.

Changing log levels at runtime

Log levels can be changed temporarily by admins; the settings become effective immediately and are reset on restart.

EntryStore 6.x uses the Spring Boot Actuator endpoint /management/loggers (see Management endpoints). GET {base}/management/loggers lists all loggers and their levels, GET {base}/management/loggers/{name} returns a single logger. The level of a logger is set with a POST request; the root logger is called ROOT:

curl -X POST -H "Cookie: auth_token=..." -H "Content-Type: application/json" -d '{"configuredLevel":"DEBUG"}' https://domain.tld/store/management/loggers/org.entrystore

Posting {} resets the level of the logger to its configured value.

A basic REST resource is available to change the log level temporarily.

Example:

curl -X PUT -H "Cookie: auth_token=..." -H "Content-Type: application/json" -d '{"level":"info","packages":{"org.entrystore":"debug"}}' http://localhost/store/management/logging

The request body contains a property for the root logger and an object if log levels of packages should be configured individually:

{
  "level": "info",
  "packages": {
    "org.apache.solr": "warn",
    "org.eclipse.jetty": "warn",
    "org.entrystore": "debug"
  }
}