Logging with the JBoss EAP 7.1 for OpenShift

Latest response

I have created my application image by pulling base image
FROM registry.access.redhat.com/jboss-eap-7/eap71-openshift

and the container is up and running but i am not able to mount the server log and application log to host system, How we can do logging with Logging with the JBoss EAP 7.1 for OpenShift, Could you please help me to resolve this.

Dockerfile


FROM registry.access.redhat.com/jboss-eap-7/eap71-openshift

allow custom external configuration

ADD standalone-full-poc.xml /opt/eap/standalone/configuration/

Create EAP User

RUN /opt/eap/bin/add-user.sh admin admin@123 --silent

Add war to Deployment folder

ADD xx.war /opt/eap/standalone/deployments/

Open Ports

EXPOSE 8080 9990 9999 8081

Start Jboss EAP

CMD ["/opt/eap/bin/standalone.sh", "-c", "standalone-full-poc.xml", "-b", "0.0.0.0","-bmanagement", "0.0.0.0"]

Responses

Hi,

Normally, the only logging that is configured in the JBoss EAP for OpenShift image is a console log handler, so logs are only outputted to the container's console. That might explain why you are unable to mount any log files from inside the container.

whether logs from container's console is saved in any location and how we can see the logs,?

Because most containers, are ephemeral, nothing is saved when they are terminated. You can view a running container's JBoss EAP log by viewing the container's console. In OpenShift, you can do this using the oc logs -f <pod> command, or opening a remote shell to the container: oc rsh <pod>.