Software AG Products 10.7 | Administering Integration Server | Using Integration Server with Docker | Running the Docker Image in an On-Premise Docker Container | Externalizing Log and Configuration Files When Running Integration Server in a Docker Container
 
Externalizing Log and Configuration Files When Running Integration Server in a Docker Container
When running Integration Server in a Docker container, Integration Server supports the use of Docker volumes to persist configuration and log files to a mounted directory on the host file system. A Docker volume exists outside of the Docker container on the file system of the host machine, making it accessible directly. Docker volumes can be used for externalizing the contents of the logs directory for the Integration Server instance and the Integration Server profile as well as the config directory for the Integration Server instance running in the Docker container.
Note:
Many container deployment solutions provide the ability to view the console logs STDOUT and STDERROR for a container. When running a Docker image of Integration Server in a Docker container, Integration Server writes the server log to the console as well as to the server.log file. You can also use the SAG_IS_AUDIT_STDOUT_LOGGERS environment variable to indicate which file-based audit logs will write to STDOUT. For more information, see Writing Audit Logs to the Console.
To make use of volumes for configuration files and log files, supply one or more of the following environment variables when executing the docker run command. Include the environment variables in the docker run command immediately before the image name.
Environment Variable
Description
HOST_DIR
The path to the mounted directory on the HOST machine to which to write the files. Providing a HOST_DIR parameter and value with the docker run command externalizes the logs and configuration artifacts of Integration Server.
SERVICE_NAME
Name of a unique directory under HOST_DIR for persisting Integration Server artifacts. When supplied, the logs and config directories are created under the <HOST_DIR>/<SERVICE_NAME> directory and all artifacts of logs and config directories are persisted in the respective directories. If SERVICE_NAME is not supplied, Integration Server instance name will be used for the name of the unique directory that gets created under the <HOST_DIR> directory. Software AG recommends specifying a unique directory for each Docker container.
PERSIST_LOGS
If set to true, the Integration Server running inside the Docker container persists the log files to <HOST_DIR>/<SERVICE_NAME>/logs where <SERVICE_NAME> is replaced by <INSTANCE_NAME> if the SERVICE_NAME environment variable is not specified. Integration Server externalizes the logs located in the Integration Server_directory /instances/<instanceName>/logs and profiles/IS_<instanceName>/logs directories. If set to false, the Integration Server running inside the Docker container does not externalize the log files. The default is true.
PERSIST_CONFIGS
If set to true, the Integration Server running inside the Docker container persists the configuration files to the <HOST_DIR>/<SERVICE_NAME>/config directory where <SERVICE_NAME>is replaced by <INSTANCE_NAME> if the SERVICE_NAME environment variable is not specified. If set to false, the Integration Server running inside the Docker container does not externalize the config files. The default is true.
Example
Consider the following docker run command:
docker run -d --name IS_Default -p 5555 -p 9999
-v /opt/myfolder:/opt/myfolder
-e HOST_DIR=/opt/myfolder -e SERVICE_NAME=demo is:microPkg
The configuration and log files will be written to the directory /opt/myfolder/demo with log files written to /opt/myfolder/demo/logs and configuration files written to /opt/myfolder/demo/config. Note that the opt/myfolder/demo/logs directory contains the log files from the Integration Server_directory /instances/instanceName/logs directory and the profiles/IS_default/logs directory.
Note:
In the example above, you need to supply -v /opt/myfolder:/opt/myfolder only if the folder is not mounted on the machine executing the Docker container and is not visible to the Docker container.