1
votes

Our code simply uses java.util.logging to log info, errors etc. I can then view these logs in multiple ways:

  1. cf logs command
  2. bluemix web console (log aggregator)
  3. kibana web ui
  4. ssh and cat /home/vcap/logs/messages.log

If I log a message, it shows up everywhere. If I log a message and pass an exception parameter, the message shows up everywhere but the exception only shows up in /home/vcap/logs/messages.log. The exception and stacktrace do not show up in cf logs, bluemix console or kibana. Since the messages.log file has a finite size and is not persisted across re-stages, I can't always look in it to get the information I need.

So how can I can ensure the full log message including the exception is being fully logged?

2

2 Answers

0
votes

By default, messages.log will only contain messages that are written or captured by the logging component. The FFDC logs (in the logs directory of each application) should contain full stack traces. See [1] and [2] for more details:

[1] https://console.bluemix.net/docs/runtimes/liberty/loggingAndTracing.html#logging_tracing

[2] https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/rwlp_logging.html

0
votes

the following article provides information specific to logging & tracing: https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/rwlp_logging.html

Table 2 provides valid logging levels. Take a look at this table and use the appropriate log level to get the information you need in logs. hope this helps.