Search code examples
dockeribm-cloudwebsphere-liberty

Accessing Liberty log files from the Bluemix Liberty docker image running locally


My goal is to develop an application that will run on WebSphere Liberty hosted in Docker and eventually running on Bluemix. During development, I have installed Docker on my local Linux PC and then downloaded from IBM the base docker image containing a configured Liberty. This image is called:

registry.ng.bluemix.net/ibmliberty

I now start this image in Docker locally in my PC and attach a shell so that I can see what is going on. I find that there is a Liberty server located at

/opt/ibm/wlp/usr/servers/defaultServer

Now here comes the puzzle.

In Liberty servers I am used to working upon, the messages produced by a server are written into a "logs/messages.log" file relative to the server. This would mean that I would have expected to find the Liberty message files here:

/opt/ibm/wlp/usr/servers/defaultServer/logs/messages.log

However, when I start my server, there is nothing there.

How can I access the logs of my Liberty server obtained from the Bluemix base image (registry.ng.bluemix.net/ibmliberty) running under Docker natively on my Linux environment on my local PC?


Solution

  • If we examine this IBM Liberty/Bluemix documentation page:

    https://console.bluemix.net/docs/images/docker_image_ibmliberty/ibmliberty_starter.html

    We will find a section that reads:

    Note: All ibmliberty images are configured to write Liberty log files to the directory /logs inside the container. All other files that are written by the Liberty server, are created in the directory /opt/ibm/wlp/output/defaultServer. You can access these files by using the shortcut /output.

    And this is the key. The Liberty server log files can be found in /logs (that is the directory called logs south of the root of the file system).