简体   繁体   中英

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

enter image description here

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

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})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM