You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by fa...@rohde-schwarz.com on 2018/06/22 13:17:51 UTC

TomEE stderr and stdout

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


Re: TomEE stderr and stdout

Posted by maciejka <ma...@gmail.com>.
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

Re: TomEE stderr and stdout

Posted by maciejka <ma...@gmail.com>.
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

Re: TomEE stderr and stdout

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Le jeu. 19 juil. 2018 à 17:05, maciejka <ma...@gmail.com>
a écrit :

> 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.
>

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).


>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>

Re: TomEE stderr and stdout

Posted by maciejka <ma...@gmail.com>.
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

Re: TomEE stderr and stdout

Posted by Romain Manni-Bucau <rm...@gmail.com>.
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>


Le jeu. 19 juil. 2018 à 15:36, maciejka <ma...@gmail.com>
a écrit :

> 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
>

Re: TomEE stderr and stdout

Posted by maciejka <ma...@gmail.com>.
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

Re: TomEE stderr and stdout

Posted by Romain Manni-Bucau <rm...@gmail.com>.
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>


Le ven. 22 juin 2018 à 15:18, <fa...@rohde-schwarz.com> a écrit :

> 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
>