Discussion:
TomEE stderr and stdout
f***@rohde-schwarz.com
2018-06-22 13:17:51 UTC
Permalink
Hi,



I am searching for a way to re-enable stdout and stderr logging in TomEE 7.0.4.



The files tomee-stderr and tomee-stdout were created automatically in 1.7 but now they are gone.



I need these files because log output that was in tomee-stdout after enabling kerberos loggin with –Dsun.security.krb5.debug=true is now nowhere to be found L



How do I “switch on” this old feature?



Thanks and best

Fabian
Romain Manni-Bucau
2018-06-22 14:26:03 UTC
Permalink
Hi,

did you try:

export CATALINA_OUT=/tmp/tomee-stdout

?

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>
Post by f***@rohde-schwarz.com
Hi,
I am searching for a way to re-enable stdout and stderr logging in TomEE 7.0.4.
The files tomee-stderr and tomee-stdout were created automatically in 1.7
but now they are gone.
I need these files because log output that was in tomee-stdout after
enabling kerberos loggin with –Dsun.security.krb5.debug=true is now nowhere
to be found L
How do I “switch on” this old feature?
Thanks and best
Fabian
maciejka
2018-07-19 13:36:20 UTC
Permalink
Hello

In my webapp I have statement:

System.out.println("Some message");

When I invoke Rest endpoint this is not printed neither in default
catalina.out log nor in file pointed by CATALINA_OUT.

Are 'System.out.println' statements diabled or redirected to /dev/null ? How
to enable them?

TomEE 7.0.4. | java 1.8.0_152 | Linux debian 3.16.0-4-amd64





--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
Romain Manni-Bucau
2018-07-19 14:45:02 UTC
Permalink
Hi,

no it is still used but if you rely on "run" command this is totally
ignored since you own the shell in this case.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>
Post by maciejka
Hello
System.out.println("Some message");
When I invoke Rest endpoint this is not printed neither in default
catalina.out log nor in file pointed by CATALINA_OUT.
Are 'System.out.println' statements diabled or redirected to /dev/null ? How
to enable them?
TomEE 7.0.4. | java 1.8.0_152 | Linux debian 3.16.0-4-amd64
--
http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
maciejka
2018-07-19 15:05:18 UTC
Permalink
I start TomEE, deploy my app, and invoke rest endpoint:
Example:

@GET
@Path("/all")
@Produces(MediaType.APPLICATION_JSON + "; charset=UTF-8")
@StringifyJSON
public Service getAll(@DefaultValue("false")
@QueryParam(CompressJsonFilter.PRETTY) boolean pretty) {
logger.debug("GET ServicesAll with param pretty {}", pretty);
System.out.println("Some text")
....
return l;
}
Method completes sucessfully.
Should 'Some text' be printed in catalina.out? It is not. Why?
What do You mean by "run" command? I do not run System.out from shell.



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
Romain Manni-Bucau
2018-07-19 15:11:44 UTC
Permalink
Post by maciejka
@GET
@Path("/all")
@Produces(MediaType.APPLICATION_JSON + "; charset=UTF-8")
@StringifyJSON
@QueryParam(CompressJsonFilter.PRETTY) boolean pretty) {
logger.debug("GET ServicesAll with param pretty {}", pretty);
System.out.println("Some text")
....
return l;
}
Method completes sucessfully.
Should 'Some text' be printed in catalina.out? It is not. Why?
What do You mean by "run" command? I do not run System.out from shell.
If you start tomcat with catalina.[bat|sh] run then it is normal, if not it
is not. Maybe share the command launched, the system properties and
environment variables (you can grab most of it from a JMX console).
Post by maciejka
--
http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
maciejka
2018-07-20 13:13:05 UTC
Permalink
This is how my process is runnung:

5323 pts/3 Sl 1:09 /usr/lib/jvm/jdk1.8.0_152/bin/java
-Djava.util.logging.config.file=/home/mkamin/servers/apache-tomee-plume-7.0.4/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-javaagent:/home/mkamin/servers/apache-tomee-plume-7.0.4/lib/openejb-javaagent.jar
-Djdk.tls.ephemeralDHKeySize=2048
-Djava.protocol.handler.pkgs=org.apache.catalina.webresources
-classpath
/home/mkamin/servers/apache-tomee-plume-7.0.4/bin/bootstrap.jar:/home/mkamin/servers/apache-tomee-plume-7.0.4/bin/tomcat-juli.jar
-Dcatalina.base=/home/mkamin/servers/apache-tomee-plume-7.0.4
-Dcatalina.home=/home/mkamin/servers/apache-tomee-plume-7.0.4
-Djava.io.tmpdir=/home/mkamin/servers/apache-tomee-plume-7.0.4/temp
org.apache.catalina.startup.Bootstrap start

I start Tomcat with 'catalina.sh start' and monitor
'/home/mkamin/servers/apache-tomee-plume-7.0.4/logs/catalina.out'

No output from System.out.println("Some text") shown. I cant see any
misconfigurated variables in my process.

The output from catalina.out when invoking this endpoint is:
20-Jul-2018 15:08:17.329 FINE [http-nio-8080-exec-1]
org.apache.openejb.server.httpd.BeginWebBeansListener.requestInitialized
Starting a new request : [0:0:0:0:0:0:0:1]
20-Jul-2018 15:08:18.378 FINE [http-nio-8080-exec-1]
org.apache.openejb.server.httpd.BeginWebBeansListener.requestDestroyed
Destroying a request : [0:0:0:0:0:0:0:1]

I think it sould be someting like:

20-Jul-2018 15:08:17.329 FINE [http-nio-8080-exec-1]
org.apache.openejb.server.httpd.BeginWebBeansListener.requestInitialized
Starting a new request : [0:0:0:0:0:0:0:1]
*Some text*
20-Jul-2018 15:08:18.378 FINE [http-nio-8080-exec-1]
org.apache.openejb.server.httpd.BeginWebBeansListener.requestDestroyed
Destroying a request : [0:0:0:0:0:0:0:1]

or am I completly missing something?






--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
maciejka
2018-07-20 13:38:34 UTC
Permalink
Ok I found it.

In conf/context.xml I had attribute swallowoutput set to true.
Solved - thx for help.



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
f***@rohde-schwarz.com
2018-07-23 14:45:27 UTC
Permalink
HI

sorry for the late reply, was on vacation.

No, I didn’t try, but I switched back to running it as a service instead of using startup/shutdown.bat and now the files reappeared.

Best
Fabian

-----Original Message-----
From: Romain Manni-Bucau <***@gmail.com>
Sent: Friday, June 22, 2018 4:26 PM
To: ***@tomee.apache.org
Subject: *EXT* [Newsletter] Re: TomEE stderr and stdout

Hi,

did you try:

export CATALINA_OUT=/tmp/tomee-stdout

?

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog <https://rmannibucau.metawerx.net/> | Old Blog <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book <https://www.packtpub.com/application-development/java-ee-8-high-performance>
Post by f***@rohde-schwarz.com
Hi,
I am searching for a way to re-enable stdout and stderr logging in
TomEE 7.0.4.
The files tomee-stderr and tomee-stdout were created automatically in
1.7 but now they are gone.
I need these files because log output that was in tomee-stdout after
enabling kerberos loggin with –Dsun.security.krb5.debug=true is now
nowhere to be found L
How do I “switch on” this old feature?
Thanks and best
Fabian
Loading...