https://bugzilla.redhat.com/show_bug.cgi?id=1048608
Bug ID: 1048608 Summary: Tomcat console output is not going to ${CATALINA_BASE}/logs/catalina.out Product: Fedora Version: 20 Component: tomcat Severity: high Assignee: ivan.afonichev@gmail.com Reporter: karthic_babu@hotmail.com QA Contact: extras-qa@fedoraproject.org CC: akurtako@redhat.com, ivan.afonichev@gmail.com, java-sig-commits@lists.fedoraproject.org, krzysztof.daniel@gmail.com
Description of problem: Tomcat console output (System.out and System.err) are not going to ${CATALINA_BASE}/logs/catalina.out. As per Apache Tomcat documentation (http://tomcat.apache.org/tomcat-7.0-doc/logging.html#Console), console messages go to ${CATALINA_BASE}/logs/catalina.out Previous versions of fedora outputs to /usr/share/tomcat/logs/catalina.out
Version-Release number of selected component (if applicable):
How reproducible: All times
Steps to Reproduce: 1. Develop a simple tomcat web application. Add debug statements in servlet that prints to System.out or System.err. 2. Deploy it to tomcat server on Fedora 20 and start the tomcat server 3. Invoke the servlet.
Actual results:
No file appears /usr/share/tomcat/logs/catalina.out
Expected results:
Debug statements put on System.out and System.err shall appear in file /usr/share/tomcat/logs/catalina.out
Additional info:
https://bugzilla.redhat.com/show_bug.cgi?id=1048608
--- Comment #1 from Ivan Afonichev ivan.afonichev@gmail.com --- There is no options to make systemd service write it's output to file see this thread about the same issue with postgres service output: http://lists.freedesktop.org/archives/systemd-devel/2012-March/004701.html
https://bugzilla.redhat.com/show_bug.cgi?id=1048608
--- Comment #2 from Karthic karthic_babu@hotmail.com --- That's not good. Fedora 19 was doing good with the original scripts from Apache tomcat package. Debug statements are needed at few instances in production environment wherein a regular java juli or log4j (both loggers) cannot be used. Console output does a great job here.
https://bugzilla.redhat.com/show_bug.cgi?id=1048608
--- Comment #3 from Ivan Afonichev ivan.afonichev@gmail.com --- Fedora have never used original tomcat scripts. It seems all stdout and strerr output of tomcat can be found via: journalctl -u tomcat or in syslog in /var/log/messages
https://bugzilla.redhat.com/show_bug.cgi?id=1048608
--- Comment #4 from Karthic karthic_babu@hotmail.com --- "journalctl -u tomcat" and "/var/log/messages" is having so many other things more than what I am looking for. I am looking for a file that is exclusively for all console outputs from Apache Tomcat (like Catalina.out).
It's hard to troubleshoot an issue with this environment. I hope Fedora resolves this issue ASAP through a fix. I was always happy with Fedora and Redhat since its inception but I am going to try other Linux flavors like openSUSE or Ubuntu till this issue gets resolved with Fedora.
https://bugzilla.redhat.com/show_bug.cgi?id=1048608
--- Comment #5 from Ivan Afonichev ivan.afonichev@gmail.com --- "journalctl -u tomcat" is having only tomcat messages. "/var/log/messages" and rsyslog will be deprecated soon. But you can configure rsyslog to write tomcat messages to separate file. I don't think this tomcat rsyslog config should be included in tomcat package because rsyslog seems to be not included in fedora by default now https://fedoraproject.org/wiki/Changes/NoDefaultSyslog
Fedora/RedHat way now is to use journald instead of logfiles. So it is recomended to use "journalctl -u tomcat"
https://bugzilla.redhat.com/show_bug.cgi?id=1048608
--- Comment #6 from Karthic karthic_babu@hotmail.com --- I overcome this issue with a workaround and could get a dedicated console file by an unconventional way.
I have to write a startup servlet and change the System.out and System.err with a file based PrintStream on the servlet init method.
I solved this problem (for myself) but if Fedora can solve it on this release through a path or fix in future release, that will benefit all the tomcat users.
https://bugzilla.redhat.com/show_bug.cgi?id=1048608
Ivan Afonichev ivan.afonichev@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |CLOSED Resolution|--- |NOTABUG Last Closed| |2014-03-25 18:22:49
https://bugzilla.redhat.com/show_bug.cgi?id=1048608
Richard Körber redhat@ml.shredzone.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |redhat@ml.shredzone.de
--- Comment #7 from Richard Körber redhat@ml.shredzone.de --- journald seems to truncate leading spaces and empty lines.
When getting a Java thread dump (via kill -3), the output returned from journalctl is almost illegible because of that.
Is there a recommended way of getting this fixed? If not, this bug should be reopened. I have tried "journalctl -o cat -u tomcat", but the output looks something like that (extract):
"main" #1 prio=5 os_prio=0 tid=0x00007f790c009000 nid=0x3587 runnable [0x00007f7914f93000] java.lang.Thread.State: RUNNABLE at java.net.PlainSocketImpl.socketAccept(Native Method) at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:404) at java.net.ServerSocket.implAccept(ServerSocket.java:545) at java.net.ServerSocket.accept(ServerSocket.java:513) at org.apache.catalina.core.StandardServer.await(StandardServer.java:451) at org.apache.catalina.startup.Catalina.await(Catalina.java:777) at org.apache.catalina.startup.Catalina.start(Catalina.java:723) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455) "VM Thread" os_prio=0 tid=0x00007f790c076800 nid=0x358e runnable "GC task thread#0 (ParallelGC)" os_prio=0 tid=0x00007f790c01e800 nid=0x3588 runnable "GC task thread#1 (ParallelGC)" os_prio=0 tid=0x00007f790c020000 nid=0x3589 runnable "GC task thread#2 (ParallelGC)" os_prio=0 tid=0x00007f790c022000 nid=0x358a runnable "GC task thread#3 (ParallelGC)" os_prio=0 tid=0x00007f790c024000 nid=0x358b runnable "GC task thread#4 (ParallelGC)" os_prio=0 tid=0x00007f790c025800 nid=0x358c runnable "GC task thread#5 (ParallelGC)" os_prio=0 tid=0x00007f790c027800 nid=0x358d runnable "VM Periodic Task Thread" os_prio=0 tid=0x00007f790c0ce800 nid=0x3596 waiting on condition JNI global references: 282 Heap PSYoungGen total 245760K, used 78375K [0x00000000eb600000, 0x00000000fef80000, 0x0000000100000000) eden space 216576K, 22% used [0x00000000eb600000,0x00000000ee66ad00,0x00000000f8980000) from space 29184K, 98% used [0x00000000f9200000,0x00000000fae1ef48,0x00000000fae80000) to space 52224K, 0% used [0x00000000fbc80000,0x00000000fbc80000,0x00000000fef80000) ParOldGen total 142336K, used 66141K [0x00000000c2200000, 0x00000000cad00000, 0x00000000eb600000) object space 142336K, 46% used [0x00000000c2200000,0x00000000c6297418,0x00000000cad00000) Metaspace used 91581K, capacity 94316K, committed 94592K, reserved 1132544K class space used 10756K, capacity 11309K, committed 11392K, reserved 1048576K
java-sig-commits@lists.fedoraproject.org