# stdout log for tomcat on gentoo - (SOLVED kind of)

## joyo222

Hi,

     This seems like a really stupid question (w/ probably a very obvious answer), but why doesn't tomcat on gentoo create a stdout log by default?  And,  how do I get it to start creating a stdout log?  I need it for debugging purposes.   I'm running Tomcat 5.5.17.

I'm not seeing anything different in logging.properties or any other *.xml files from my tomcat installation on Windows, and tomcat on Windows creates stdout logs out of the box.

Thanks in advance!Last edited by joyo222 on Mon Oct 16, 2006 10:10 pm; edited 1 time in total

----------

## nelchael

Did you check catalina.out in /var/log/tomcat-*/ ?

----------

## joyo222

yes...

the catalina log only shows starting logs, it doesn't show any stdout, and the localhost log shows some stderr info...but I'm not seeing any obvious way to get *all* the internal output of Tomcat.

From the config files, it looks like it should be doing it already so I'm kind of confused.

Thanks.

----------

## joyo222

here is pretty much all that shows up in the catalina.2006-10-13.log.  There is no catalina.out or stdout.log created in the logs dir.

 *Quote:*   

> Oct 13, 2006 9:58:59 PM org.apache.coyote.http11.Http11BaseProtocol start
> 
> INFO: Starting Coyote HTTP/1.1 on http-8080
> 
> Oct 13, 2006 9:58:59 PM org.apache.coyote.http11.Http11BaseProtocol start
> ...

 

i changed the logging to 'ALL' in the logging.properties, but it didn't really help at all.  I still don't see a way to capture tomcat's stdout info.  Is this a limitation of using start-stop-daemon to start tomcat?  Should I just be using the *.sh scripts in the bin directory instead of gentoo's init scripts?  That seems kind of stupid, but I don't see any other way to capture stdout.

If anyone has any other ideas on this (I can't be the only one trying to get stdout logging on gentoo), I would really appreciate it.  thanks.

----------

## joyo222

ok... since apparently no one uses tomcat or has had this problem, I just manually edited the gentoo init script to do what I wanted.  It's pretty ugly =), but it works...

I hope this can help somebody else who has had a similar problem:

```
38,40c38,40

<       local arguments="--start --quiet --background --chuid tomcat:tomcat \

<               --make-pidfile --pidfile /var/run/tomcat.pid"

<       start-stop-daemon ${arguments} --exec ${executor} -- ${OPTS_CP} "$@" ${CATALINA_ARGS} ${TOMCAT_START}

---

>       local arguments="--start --quiet --chuid tomcat:tomcat \

>               --make-pidfile --pidfile /var/run/tomcat.pid"

>       exec start-stop-daemon ${arguments} --exec ${executor} -- ${OPTS_CP} "$@" ${CATALINA_ARGS} ${TOMCAT_START} >> "$CATALINA_BASE"/logs/catalina.out 2>&1 &

```

----------

## aschrijver

Thanks! This is exactly what I needed!

This is still not fixed correctly in the initscript from the ebuild.   :Sad: 

----------

## wltjr

I was experimenting with a fix. Even tried the suggested code, but was doing it via a var. For some reason that was causing bootstrap to eat part of the command line, either the 2>&1 or the last &. Either way, by specifying it as show above worked. So I modified the init scripts and committed them to tree. Less the last & since, start-stop handles backgrounding of the process. No need to do it again.

You can either edit script or re-emerge tomcat. If running stable, you will have to re-emerge. Others on ~arch simply update your system to get rev-bumped package version with updated init cript.

Although I would like confirmation if this is capturing the output or not. The default Tomcat bin out of box when started has same output in catalina*.log as it does in catalina.out. However this is not the case, despite the >> ../catalina.out stuff being added to init script.

Any further comments about this not working or etc, please add to bug# 162379, thanks.

----------

