Tuesday, 30 August 2016

WebSphere Liberty Profile on Docker - Where are my logs ?

As per previous posts, I'm tinkering with Docker, using WebSphere Liberty Profile as my starting point

One thing that was confusing me was the lack of Liberty logging ….

In "normal" Liberty, the logs are here: -

ls -al ~/wlp/usr/servers/defaultServer/logs/

total 344
drwxr-x---  5 davidhay  staff     170 28 Aug 05:34 .
drwxr-x---  9 davidhay  staff     306 27 Aug 10:14 ..
-rw-r-----  1 davidhay  staff   47608 28 Aug 05:34 console.log
-rw-r-----  1 davidhay  staff  123862 28 Aug 05:34 messages.log
drwxr-x---  2 davidhay  staff      68 28 Aug 05:34 state


and, yet, in a Docker container built from the latest WebSphere Liberty Profile image: -

docker images

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
websphere-liberty   latest              f042ad3a168c        2 weeks ago         444.4 MB
websphere-liberty   webProfile7         efa42bcc5850        2 weeks ago         396 MB


docker ps -a

CONTAINER ID        IMAGE                      COMMAND                  CREATED             STATUS              PORTS                NAMES
89a3ba2841e4        websphere-liberty:latest   "/opt/ibm/docker/dock"   8 minutes ago       Up 8 minutes        9080/tcp, 9443/tcp   hungry_wozniak


I haz no logs: -

ls -al /opt/ibm/wlp/usr/servers/defaultServer/

total 28
drwxr-x--- 5 root root 4096 Aug 30 08:07 .
drwxr-xr-x 6 root root 4096 Aug 30 08:07 ..
drwxr-x--- 2 root root 4096 Aug 11 22:11 apps
drwxr-xr-x 3 root root 4096 Aug 30 08:07 configDropins
drwxr-x--- 2 root root 4096 Aug 11 22:11 dropins
-rw-r----- 1 root root   25 Aug 11 22:11 server.env
-rw-rw-r-- 1 root root 1622 Aug 11 22:13 server.xml


Thankfully, I found this: -

<snip>
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.
</snip>


and, quelle surprise, there they are: -

ls /output

logs  messaging  resources  work area

ls -al /output

lrwxrwxrwx 1 root root 33 Aug 11 22:11 /output -> /opt/ibm/wlp/output/defaultServer

ls -al /opt/ibm/wlp/output/defaultServer/

total 24
drwxr-x--- 6 root root 4096 Aug 30 08:07 .
drwxr-x--T 7 root root 4096 Aug 30 08:07 ..
drwxr-x--- 3 root root 4096 Aug 30 08:07 logs
drwxr-x--- 3 root root 4096 Aug 30 08:07 messaging
drwxr-x--- 3 root root 4096 Aug 30 08:07 resources
drwxr-x--- 5 root root 4096 Aug 30 08:07 workarea


ls -al /opt/ibm/wlp/output/defaultServer/logs/

total 12
drwxr-x--- 3 root root 4096 Aug 30 08:07 .
drwxr-x--- 6 root root 4096 Aug 30 08:07 ..
drwxr-x--- 2 root root 4096 Aug 30 08:07 state


ls -al /logs/

total 20
drwxr-xr-x  2 root root  4096 Aug 30 08:07 .
drwxr-xr-x 61 root root  4096 Aug 30 08:07 ..
-rw-r-----  1 root root 10681 Aug 30 08:07 messages.log


cat /logs/messages.log 

********************************************************************************
product = WebSphere Application Server 16.0.0.2 (wlp-1.0.13.cl160220160526-2258)
wlp.install.dir = /opt/ibm/wlp/
server.output.dir = /opt/ibm/wlp/output/defaultServer/
java.home = /opt/ibm/java/jre
java.version = 1.8.0
java.runtime = Java(TM) SE Runtime Environment (pxa6480sr3fp10-20160720_02 (SR3 FP10))
os = Linux (4.4.15-moby; amd64) (en_US)
process = 1@89a3ba2841e4
********************************************************************************
[8/30/16 8:07:42:009 UTC] 00000001 com.ibm.ws.kernel.launch.internal.FrameworkManager           A CWWKE0001I: The server defaultServer has been launched.
[8/30/16 8:07:42:024 UTC] 00000001 com.ibm.ws.kernel.launch.internal.FrameworkManager           A CWWKE0100I: This product is licensed for development, and limited production use. The full license terms can be viewed here: https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/base_ilan/ilan/16.0.0.2/lafiles/en.html

...
[8/30/16 8:07:50:917 UTC] 0000001a com.ibm.ws.cache.ServerCache                                 I DYNA1001I: WebSphere Dynamic Cache instance named baseCache initialized successfully.
[8/30/16 8:07:50:920 UTC] 0000001a com.ibm.ws.cache.ServerCache                                 I DYNA1071I: The cache provider default is being used.
[8/30/16 8:07:50:920 UTC] 0000001a com.ibm.ws.cache.CacheServiceImpl                            I DYNA1056I: Dynamic Cache (object cache) initialized successfully.
[8/30/16 8:07:51:361 UTC] 0000001a com.ibm.ws.transport.iiop.internal.ORBWrapperInternal        A CWWKI0001I: The CORBA name server is now available at corbaloc:iiop:localhost:2809/NameService.
[8/30/16 8:07:51:711 UTC] 00000021 com.ibm.ws.kernel.feature.internal.FeatureManager            A CWWKF0012I: The server installed the following features: [servlet-3.1, beanValidation-1.1, ssl-1.0, jndi-1.0, jca-1.7, ejbPersistentTimer-3.2, appSecurity-2.0, j2eeManagement-1.1, jdbc-4.1, wasJmsServer-1.0, jaxrs-2.0, javaMail-1.5, cdi-1.2, webProfile-7.0, jcaInboundSecurity-1.0, jpa-2.1, jsp-2.3, ejbLite-3.2, managedBeans-1.0, jsf-2.2, ejbHome-3.2, jaxws-2.2, jsonp-1.0, el-3.0, jaxrsClient-2.0, concurrent-1.0, appClientSupport-1.0, ejbRemote-3.2, javaee-7.0, jaxb-2.2, mdb-3.2, jacc-1.5, batch-1.0, ejb-3.2, json-1.0, jaspic-1.1, distributedMap-1.0, websocket-1.1, wasJmsSecurity-1.0, wasJmsClient-2.0].
[8/30/16 8:07:51:711 UTC] 00000021 com.ibm.ws.kernel.feature.internal.FeatureManager            I CWWKF0008I: Feature update completed in 7.901 seconds.
[8/30/16 8:07:51:712 UTC] 00000021 com.ibm.ws.kernel.feature.internal.FeatureManager            A CWWKF0011I: The server defaultServer is ready to run a smarter planet.

No comments:

Note to self - use kubectl to query images in a pod or deployment

In both cases, we use JSON ... For a deployment, we can do this: - kubectl get deployment foobar --namespace snafu --output jsonpath="{...