How to view TIBCO Streaming console output in Kubernetes

How to view TIBCO Streaming console output in Kubernetes

book

Article ID: KB0076743

calendar_today

Updated On:

Products Versions
TIBCO Streaming 10.x

Description

If a TIBCO Streaming application is run in a Kubernetes deployment environment, only the node installation and startup related output (i.e. output from the 'epadmin' command) will be seen by default.  For example..
> kubectl --namespace=development logs MyTIBCOStreamingPOD
[MyTIBCOStreamingPOD.development] 	Installing node
[MyTIBCOStreamingPOD.development] 		PRODUCTION executables
[MyTIBCOStreamingPOD.development] 		Memory shared memory
[MyTIBCOStreamingPOD.development] 		2 concurrent allocation segments
[MyTIBCOStreamingPOD.development] 		Host name streaming-host-1
[MyTIBCOStreamingPOD.development] 		Container tibco/sb
[MyTIBCOStreamingPOD.development] 		Starting container services
[MyTIBCOStreamingPOD.development] 		Loading node configuration
[MyTIBCOStreamingPOD.development] 		Auditing node security
[MyTIBCOStreamingPOD.development] 		Deploying application
[MyTIBCOStreamingPOD.development] 			Engine default-engine-for-streaming-node
[MyTIBCOStreamingPOD.development] 		Application deployed
[MyTIBCOStreamingPOD.development] 		Administration port is 2000
[MyTIBCOStreamingPOD.development] 		Discovery Service running on port 54321
[MyTIBCOStreamingPOD.development] 		Service name is MyTIBCOStreamingPOD.development
[MyTIBCOStreamingPOD.development] 	Node installed
[MyTIBCOStreamingPOD.development] 	Starting node
[MyTIBCOStreamingPOD.development] 		Engine application::default-engine-for-streaming-node started
[MyTIBCOStreamingPOD.development] 		Loading node configuration
[MyTIBCOStreamingPOD.development] 		Auditing node security
[MyTIBCOStreamingPOD.development] 		Host name streaming-host-1
[MyTIBCOStreamingPOD.development] 		Administration port is 2000
[MyTIBCOStreamingPOD.development] 		Discovery Service running on port 54321
[MyTIBCOStreamingPOD.development] 		Service name is MyTIBCOStreamingPOD.development
[MyTIBCOStreamingPOD.development] 	Node started
However, the console output for the Streaming application is not seen by default when using the 'kubectl logs' command. 

Issue/Introduction

How to view TIBCO Streaming console output in Kubernetes.

Resolution

To view the application's console output, add a ConsoleAppender to a custom logback.xml (placed in your project under src/main/resources). This will force the "default-engine-for..." logs to the screen as long as the process is running. For example..
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <appender name="RootConsoleAppender" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <charset>UTF-8</charset>
      <pattern>%d{yyyy-MM-dd HH:mm:ss.}%usecs%d{Z} [%process:%thread] %-5level %logger: %msg%n</pattern>
    </encoder>
  </appender>
  <root>
    <level value="info"/>
    <appender-ref ref="RootConsoleAppender" />
  </root>
</configuration>
In addition, enable tty in your Kubernetes configuration:
containers:
- name: myapp
#
# docker image to use
#
image: myapp:1.0.0
#
# Share application logs to docker console
#
tty: true