How to create the custom path for the logs in the domain mode container version

30 views Asked by At

enter image description here

I need to change to the custom location path for the logs in the container version

1

There are 1 answers

5
cam-rod On

The WildFly image places the server installation at /opt/jboss/wildfly, where jboss is the name of the container's user (you can view the Dockerfile here). The easiest way to store the logs outside the container is to mount to the server log location (Unix style filepath for simplicity, I'm not too familiar with Windows' formatting):

docker run -it -v /c/path/to/log_folder:/opt/jboss/wildfly/standalone/log:rw quay.io/wildfly/wildfly

If you need to move the location within the container, you can edit the config file (/opt/jboss/wildfly/standalone/configuration/standalone.xml) or use the JBoss CLI on a running container:

docker exec -it <container_name> /opt/jboss/wildfly/bin/jboss-cli.sh -c
[standalone@localhost:9990 /] /subsystem=logging/periodic-rotating-file-handler=FILE:write-attribute(name=file,value={path=server.log,relative-to=jboss.server.log.dir})