Configuration
Configure the JVM
There are two ways to provide system properties and JVM options to the JVM process running inside a Docker container.
1. Predefined JVM scenarios
Select from a set of predefined scenarios by setting the environment variable JVM_CONFIG
to a comma-separated list of scenario IDs. See table below for available scenarios.
Pay attention to environment variables in the property sets, since they must be provided at runtime.
JMX_REMOTE
com.sun.management.jmxremote=true
com.sun.management.jmxremote.port=7091
com.sun.management.jmxremote.rmi.port=7091
com.sun.management.jmxremote.local.port=7092
com.sun.management.jmxremote.authenticate=false
com.sun.management.jmxremote.ssl=false
java.rmi.server.hostname=$RMI_SERVER_HOSTNAME
JMX
fortifiedid.metrics.jmx.enabled=true fortified.vertx.config.path=config/jmx/vertx-config.json
PROMETHEUS
fortifiedid.metrics.prometheus.enabled=true fortified.vertx.config.path=config/prometheus/vertx-config.json
Example:
docker run -e JVM_CONFIG=jmx,jmx_remote -e RMI_SERVER_HOSTNAME=192.168.0.10 -p 8080:8080 -p 7091:7091 --detach --name integrity fortifiedid.jfrog.io/docker/fortifiedid/integrity:<version> -c Node config/config.json
2. Custom JVM configuration
Define a custom set of system properties and JVM options. To accomplish this, use the docker volumes
to override the file
/opt/fortifiedid/integrity/bin/default/java.config
at runtime. In this case, all mandatory properties and options must be provided, since no other items will be provided by the system.
Example:
docker run -v /path/to/java.config:/opt/fortifiedid/integrity/bin/default/java.config -p 8080:8080 --detach --name integrity fortifiedid.jfrog.io/docker/fortifiedid/integrity:<version> -c Node config/config.json
Configure logging
The application uses Log4J2 logging. Default configuration is embedded in the Docker image, in the file /opt/fortifiedid/integrity/config/log4j2.xml
.
As a convenience, it is possible to set the default log level of this configuration by providing the environment variable LOG_LEVEL
at runtime. This variable can be any valid Log4j log level: ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF
. This log level will affect all loggers.
For finer control over the logging configuration, use docker volumes to override the log configuration file at runtime. Example:
docker run -v /path/to/log4j2.xml:/opt/fortifiedid/integrity/config/log4j2.xml -p 8080:8080 --detach --name integrity fortifiedid.jfrog.io/docker/fortifiedid/integrity:<version> -c Node config/config.json
The preferred way to manage application logging from a Docker container is by using an appropriate Docker logging driver.