Skip to Content
0
Former Member
Jul 11, 2019 at 11:23 AM

How to enable log debug for tomcat?

795 Views

We met a problem about Tomcat cluster setup, and the error is :

INFO | jvm 1 | srvmain | 2019/07/09 13:11:47.967 | Jul 09, 2019 1:11:47 PM org.apache.catalina.ha.session.DeltaManager startInternal INFO | jvm 1 | srvmain | 2019/07/09 13:11:47.967 | INFO: Register manager [localhost#] to cluster element [Engine] with name [Catalina] INFO | jvm 1 | srvmain | 2019/07/09 13:11:47.967 | Jul 09, 2019 1:11:47 PM org.apache.catalina.ha.session.DeltaManager startInternal INFO | jvm 1 | srvmain | 2019/07/09 13:11:47.967 | INFO: Starting clustering manager at [localhost#] INFO | jvm 1 | srvmain | 2019/07/09 13:11:47.967 | Jul 09, 2019 1:11:47 PM org.apache.catalina.ha.session.DeltaManager getAllClusterSessions INFO | jvm 1 | srvmain | 2019/07/09 13:11:47.967 | INFO: Manager [localhost#], requesting session state from [org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 11, 128, 77}:4000,{10, 11, 128, 77},4000, alive=10383927, securePort=-1, UDP Port=-1, id={37 41 127 80 -126 -32 70 109 -82 91 -19 -32 -4 31 -106 42 }, payload={}, command={}, domain={}, ]]. This operation will timeout if no session state has been received within [60] seconds. INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | Jul 09, 2019 1:11:48 PM org.apache.catalina.ha.session.DeltaManager messageReceived INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | SEVERE: Manager [localhost#]: Unable to receive message through Tnel INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | java.lang.ClassCastException: java.io.ObjectStreamClass cannot be cast to java.lang.String INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at java.io.ObjectInputStream.readTypeString(ObjectInputStream.java:1650) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at java.io.ObjectStreamClass.readNonProxy(ObjectStreamClass.java:803) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at java.io.ObjectInputStream.readClassDescriptor(ObjectInputStream.java:891) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1857) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1751) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2042) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at java.io.ObjectInputStream.readObject(ObjectInputStream.java:431) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at org.apache.catalina.ha.session.DeltaSession.doReadObject(DeltaSession.java:746) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at org.apache.catalina.ha.session.DeltaSession.readObjectData(DeltaSession.java:567) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at org.apache.catalina.ha.session.DeltaManager.deserializeSessions(DeltaManager.java:619) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at org.apache.catalina.ha.session.DeltaManager.handleALL_SESSION_DATA(DeltaManager.java:1332) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at org.apache.catalina.ha.session.DeltaManager.messageReceived(DeltaManager.java:1174) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at org.apache.catalina.ha.session.DeltaManager.messageDataReceived(DeltaManager.java:929) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at org.apache.catalina.ha.session.ClusterSessionListener.messageReceived(ClusterSessionListener.java:77) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:783) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:764) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at org.apache.catalina.tribes.group.GroupChannel.messageReceived(GroupChannel.java:327) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:91) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.messageReceived(TcpFailureDetector.java:116) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:91) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:91) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at org.apache.catalina.tribes.group.ChannelCoordinator.messageReceived(ChannelCoordinator.java:276) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at org.apache.catalina.tribes.transport.ReceiverBase.messageDataReceived(ReceiverBase.java:261) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at org.apache.catalina.tribes.transport.nio.NioReplicationTask.drainChannel(NioReplicationTask.java:213) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at org.apache.catalina.tribes.transport.nio.NioReplicationTask.run(NioReplicationTask.java:101) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | at java.lang.Thread.run(Thread.java:748) INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.326 | INFO | jvm 1 | srvmain | 2019/07/09 13:11:48.436 | Jul 09, 2019 1:11:48 PM org.apache.catalina.ha.session.DeltaManager waitForSendAllSessions

After checking the source code of tomcat, the error might be caused by there is object not serializable in session. And there are some debug level log in org.apache.catalina.ha.session.DeltaManager, so in order to find which object is not serializable, I tried to set up a debug log for tomcat refer to https://tomcat.apache.org/tomcat-8.0-doc/logging.html

The guide works for original tomcat. However neither adding the logging.properties to platform/tomcat/conf nor log4j config works in Hybris.

Is there a way to show the debug level log for tomcat in Hybris? Many thanks.