I need to change to the custom location path for the logs in the container version
Asked
Active
Viewed 26 times
1 Answers
0
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})

cam-rod
- 161
- 7
-
Thanks for the answer i am trying the methods, Could you please mention where we need to change the standalone.xml for the custom path – Rahul kumar Reddy Jan 06 '23 at 07:20
-
i need to change here only..? – Rahul kumar Reddy Jan 06 '23 at 07:20
-
Yes, that section should be all you need. – cam-rod Jan 06 '23 at 17:55
-
Thanks cam-rod , In standalone.xml i changed and i removed the relativeto="Jboss.server.log.dir", But it storing in both locations custom&default , same like that i need to change for the workpoint.logs ..? Could you please help me – Rahul kumar Reddy Jan 08 '23 at 07:02
-
I'm not familar with the workpoint logs, but you might find something in the [Admin Guide](https://docs.wildfly.org/27/Admin_Guide.html#Logging). – cam-rod Jan 10 '23 at 20:14