You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Paul Chauvet <ch...@newpaltz.edu> on 2022/08/11 16:09:24 UTC

Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

Hello all,

I haven't been able to figure this out - but a catalina.out file is not being generated for me.  Sadly - I'm trying to troubleshoot an issue (with a vendor's saml implementation) which wants to write to that file (and doesn't seem to be writing what I need to catalina.YYYY-DD-MM.logs, /var/log/messages, or into the journal as seen by "journalctl --unit=tomcat.service").


My environment:

  *   RHEL 7.9 (though the same happens on my RHEL 8 hosts)
  *   Tomcat 9.0.63 (installed from the .tar.gz download from https://tomcat.apache.org/download-90.cgi - not from the OS repository)
  *   Using jsvc via a systemd startup script to start Tomcat (that script is at the bottom of this message).

I've tried specifying CATALINA_OUT in setenv.sh, and in my systemd startup script.  I've temporarily disabled SELinux to see if that makes a difference.  Neither of those work.  What does work, though I would like to avoid it, is if I start Tomcat via ./startup.sh.  If I do that - catalina.out is generated but I'm not getting other settings I set in my systemd script (or having it tied to startup/shutdown of the OS).

I don't know what I'm missing or doing wrong here, or if there's something about jsvc that is an issue here that I can't figure out.  I've been unable to find anything related to this (lots of posts about catalina.out related to operating system distributed versions of Tomcat that don't appear to apply).

Any advice here would be greatly appreciated!

My systemd startup script is below.


[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target

[Service]
Type=forking
PIDFile=/var/run/tomcat.pid
UMask=0007

# Tomcat variables
Environment='JAVA_HOME=/usr/lib/jvm/java-openjdk'
Environment='CATALINA_PID=/var/run/tomcat.pid'
Environment='CATALINA_HOME=/opt/tomcat/latest'
Environment='CATALINA_BASE=/opt/tomcat/latest'
Environment='CATALINA_OPTS=-Xms512M -Xmx2048M -XX:+UseParallelGC -server'
Environment='CATALINA_OUT=/var/log/tomcat/catalina.out'

# Needed to make use of Tomcat Native Library
Environment='LD_LIBRARY_PATH=/opt/tomcat/latest/lib'

ExecStart=/opt/tomcat/latest/bin/jsvc \
            -Dcatalina.home=${CATALINA_HOME} \
            -Dcatalina.base=${CATALINA_BASE} \
            -Djava.awt.headless=true \
            -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
            -Djava.util.logging.config.file=${CATALINA_BASE}/conf/logging.properties \
            -Dlog4j2.FormatMsgNoLookups=true \
            -cp ${CATALINA_HOME}/bin/commons-daemon.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar \
            -pidfile ${CATALINA_PID} \
            -java-home ${JAVA_HOME} \
            -user tomcat \
            $CATALINA_OPTS \
            org.apache.catalina.startup.Bootstrap

ExecStop=/opt/tomcat/latest/bin/jsvc \
            -pidfile ${CATALINA_PID} \
            -stop \
            org.apache.catalina.startup.Bootstrap

[Install]
WantedBy=multi-user.target







Paul Chauvet, CISSP

Information Security Officer

State University of New York at New Paltz

chauvetp@newpaltz.edu


Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Paul,

On 8/11/22 12:09, Paul Chauvet wrote:
> Hello all,
> 
> I haven't been able to figure this out - but a catalina.out file is not being generated for me.  Sadly - I'm trying to troubleshoot an issue (with a vendor's saml implementation) which wants to write to that file (and doesn't seem to be writing what I need to catalina.YYYY-DD-MM.logs, /var/log/messages, or into the journal as seen by "journalctl --unit=tomcat.service").
> 
> 
> My environment:
> 
>    *   RHEL 7.9 (though the same happens on my RHEL 8 hosts)
>    *   Tomcat 9.0.63 (installed from the .tar.gz download from https://tomcat.apache.org/download-90.cgi - not from the OS repository)
>    *   Using jsvc via a systemd startup script to start Tomcat (that script is at the bottom of this message).

Typically, systemd captures stdout/stderr and sends it to journald or 
whatever. Writing to log files is apparently too quaint.

> I've tried specifying CATALINA_OUT in setenv.sh, and in my systemd startup script.  I've temporarily disabled SELinux to see if that makes a difference.  Neither of those work.  What does work, though I would like to avoid it, is if I start Tomcat via ./startup.sh.  If I do that - catalina.out is generated but I'm not getting other settings I set in my systemd script (or having it tied to startup/shutdown of the OS).
> 
> I don't know what I'm missing or doing wrong here, or if there's something about jsvc that is an issue here that I can't figure out.  I've been unable to find anything related to this (lots of posts about catalina.out related to operating system distributed versions of Tomcat that don't appear to apply).

It seems that you are just resisting doing things the Systemd Way.

Have you tried poking-around with journalctl to see if you can get the logs?

If "catalina.sh start/run" works for you, then the issue lies with your 
systemd configuration/environment.

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

Posted by Paul Chauvet <ch...@newpaltz.edu>.
Hi Noelette,

Definitely not a dumb question.  Trust me - I've missed obvious things before.  In this case though - Tomcat is definitely starting fine via systemd and has been running without issue (through various upgrades from 8.5.x and through 9.0.x versions, though I still need to upgrade to 9.0.64).

Everything's working fine - except the catalina.out logging for opensaml (which we're trying to troubleshoot as we move from CAS to SAML for authentication - but without the logs for the saml issues the vendor couldn't assist).  Now that I have those debug logs - it's in that vendor's hands as to find out what's wrong 🙂.

I will look at the daemon startup method you list though - thank you!



Paul Chauvet, CISSP

Information Security Officer

State University of New York at New Paltz

chauvetp@newpaltz.edu

[cid:aaa5e02a-2ded-4434-b7d6-c140c723291e]

Keep on a lookout for fraudulent emails!  For examples reported to us - see the "New Paltz PhishBowl<https://www.newpaltz.edu/phishbowl>"

________________________________
From: Noelette Stout <no...@isu.edu>
Sent: Thursday, August 11, 2022 2:52 PM
To: Tomcat Users List <us...@tomcat.apache.org>
Subject: Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

CAUTION: Message from a non-New Paltz email server. Treat message, links, and attachments with extra caution.


dumb question time -- Is tomcat actually starting up all the way when you
run with systemd? One of the things that I ran into with tomcat and systemd
was that the default service start timeout was not enough time for tomcat
to start. Also, I'm not starting tomcat by calling jsvc directly; I'm using
the daemon.sh script. Here's what one of my tomcat unit files looks like:

[Unit]
Description= CAS server (Tomcat)
After=syslog.target network-online.target

[Service]
Type=forking
User=tomcat
Group=tomcat
Environment=CATALINA_HOME=/var/local/tomcat/tomcat
Environment=CATALINA_BASE=/var/local/tomcat/cas
Environment=JAVA_HOME=/var/local/tomcat/java
ExecStart=/var/local/tomcat/tomcat/bin/daemon.sh start
ExecStop=/var/local/tomcat/tomcat/bin/daemon.sh stop
RemainAfterExit=yes
TimeoutSec=300
[Install]
WantedBy=multi-user.target

I also have a setenv.sh file in $CATALINA_BASE/bin with this (yes, it's a
little redundant):
export JAVA_HOME="/var/local/tomcat/java"
export CATALINA_HOME="/var/local/tomcat/tomcat"
export CATALINA_BASE="/var/local/tomcat/cas"
CATALINA_PID="$CATALINA_BASE/logs/tomcat.pid"
CATALINA_OPTS="-server -Xmx512m -Dlog4j2.formatMsgNoLookups=true"
SERVICE_START_WAIT_TIME=300

I always get a catalina-daemon.out file when starting this way.

On Thu, Aug 11, 2022 at 12:25 PM Paul Chauvet <ch...@newpaltz.edu> wrote:

> Hi Chris,
>
> I honestly don't care if they are in catalina.out, /var/log/messages, or a
> file named 'awesomestuff.log' - I just know that things are MISSING.
>
> Let me be more specific - sorry if I'm not being clear here!
>
>
> Normal operation (running via systemd) - I get Tomcat startup/shutdown,
> and some other info in catalina-YYYY-MM-DD.log.  I don't get the debug
> information for opensaml.
>
> When I start via startup.sh directly - a lot more is being logged to
> catalina.out than anywhere else I have been able to find.
>
>
> I tried starting Tomcat without using systemd by just doing the following
> - but still no catalina.out.
> /opt/tomcat/latest/bin/jsvc \
>             -Dcatalina.home=${CATALINA_HOME} \
>             -Dcatalina.base=${CATALINA_BASE} \
>             -Djava.awt.headless=true \
>
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
>
> -Djava.util.logging.config.file=${CATALINA_BASE}/conf/logging.properties \
>             -Dlog4j2.FormatMsgNoLookups=true \
>             -cp
> ${CATALINA_HOME}/bin/commons-daemon.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar
> \
>             -pidfile ${CATALINA_PID} \
>             -java-home ${JAVA_HOME} \
>             -user tomcat \
>             $CATALINA_OPTS \
>             org.apache.catalina.startup.Bootstrap
>
>
>
> I ended up temporarily just starting via startup.sh just long enough to
> get the error logs I was looking for into catalina.out - then started it up
> again normally.
>
>
> Sorry to bother everyone with this - but I appreciate your assistance!
>
>
> ________________________________
> From: Christopher Schultz <ch...@christopherschultz.net>
> Sent: Thursday, August 11, 2022 1:34 PM
> To: users@tomcat.apache.org <us...@tomcat.apache.org>
> Subject: Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat
> 9.0.63)
>
> CAUTION: Message from a non-New Paltz email server. Treat message, links,
> and attachments with extra caution.
>
>
> Paul,
>
> On 8/11/22 13:03, Paul Chauvet wrote:
> > Hi Noelette,
> >
> > Thanks for the reponse!
> >
> > It logs to catalina-YYYY-MM-DD.log, localhost.YY-MM-DD.log,
> localhost_access_log.YYYY-MM-DD.txt - but it doesn't use catalina.out.
> >
> > When I temporarily started Tomcat via startup.sh it did create
> catalina.out (and start logging the things that it wasn't logging into the
> other files, /var/log/messages, or the systemd journal).
> >
> > I'll see if I can get my setup (at least temporarily) working with
> startup.sh.
>
> OH... you might just be misunderstanding what's happening.
>
> When you use catalina.sh start (or startup.sh), that script just does this:
>
> java [stuff] > ${CATALINA_BASE}/logs/catalina.out 2>&1
>
> When you run with jsvc, it includes some built-in file-rotation and so
> catalina-[date].log is the same thing.
>
> Are you irritated that you can't read the logs, or are you irritated
> that the log file isn't specifically "catalina.out"?
>
> -chris
>
> > ________________________________
> > From: Noelette Stout <no...@isu.edu>
> > Sent: Thursday, August 11, 2022 12:35 PM
> > To: Tomcat Users List <us...@tomcat.apache.org>
> > Subject: Re: Issue with catalina.out not being generated (RHEL 7.9,
> tomcat 9.0.63)
> >
> > CAUTION: Message from a non-New Paltz email server. Treat message,
> links, and attachments with extra caution.
> >
> >
> > We use systemd with jsvc and our tomcat instances write to
> > $CATALINA_BASE/logs by default.
> >
> > On Thu, Aug 11, 2022 at 10:10 AM Paul Chauvet <ch...@newpaltz.edu>
> wrote:
> >
> >> Hello all,
> >>
> >> I haven't been able to figure this out - but a catalina.out file is not
> >> being generated for me.  Sadly - I'm trying to troubleshoot an issue
> (with
> >> a vendor's saml implementation) which wants to write to that file (and
> >> doesn't seem to be writing what I need to catalina.YYYY-DD-MM.logs,
> >> /var/log/messages, or into the journal as seen by "journalctl
> >> --unit=tomcat.service").
> >>
> >>
> >> My environment:
> >>
> >>    *   RHEL 7.9 (though the same happens on my RHEL 8 hosts)
> >>    *   Tomcat 9.0.63 (installed from the .tar.gz download from
> >> https://tomcat.apache.org/download-90.cgi - not from the OS repository)
> >>    *   Using jsvc via a systemd startup script to start Tomcat (that
> script
> >> is at the bottom of this message).
> >>
> >> I've tried specifying CATALINA_OUT in setenv.sh, and in my systemd
> startup
> >> script.  I've temporarily disabled SELinux to see if that makes a
> >> difference.  Neither of those work.  What does work, though I would
> like to
> >> avoid it, is if I start Tomcat via ./startup.sh.  If I do that -
> >> catalina.out is generated but I'm not getting other settings I set in my
> >> systemd script (or having it tied to startup/shutdown of the OS).
> >>
> >> I don't know what I'm missing or doing wrong here, or if there's
> something
> >> about jsvc that is an issue here that I can't figure out.  I've been
> unable
> >> to find anything related to this (lots of posts about catalina.out
> related
> >> to operating system distributed versions of Tomcat that don't appear to
> >> apply).
> >>
> >> Any advice here would be greatly appreciated!
> >>
> >> My systemd startup script is below.
> >>
> >>
> >> [Unit]
> >> Description=Apache Tomcat Web Application Container
> >> After=syslog.target network.target
> >>
> >> [Service]
> >> Type=forking
> >> PIDFile=/var/run/tomcat.pid
> >> UMask=0007
> >>
> >> # Tomcat variables
> >> Environment='JAVA_HOME=/usr/lib/jvm/java-openjdk'
> >> Environment='CATALINA_PID=/var/run/tomcat.pid'
> >> Environment='CATALINA_HOME=/opt/tomcat/latest'
> >> Environment='CATALINA_BASE=/opt/tomcat/latest'
> >> Environment='CATALINA_OPTS=-Xms512M -Xmx2048M -XX:+UseParallelGC
> -server'
> >> Environment='CATALINA_OUT=/var/log/tomcat/catalina.out'
> >>
> >> # Needed to make use of Tomcat Native Library
> >> Environment='LD_LIBRARY_PATH=/opt/tomcat/latest/lib'
> >>
> >> ExecStart=/opt/tomcat/latest/bin/jsvc \
> >>              -Dcatalina.home=${CATALINA_HOME} \
> >>              -Dcatalina.base=${CATALINA_BASE} \
> >>              -Djava.awt.headless=true \
> >>
> >> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
> >>
> >>
> -Djava.util.logging.config.file=${CATALINA_BASE}/conf/logging.properties \
> >>              -Dlog4j2.FormatMsgNoLookups=true \
> >>              -cp
> >>
> ${CATALINA_HOME}/bin/commons-daemon.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar
> >> \
> >>              -pidfile ${CATALINA_PID} \
> >>              -java-home ${JAVA_HOME} \
> >>              -user tomcat \
> >>              $CATALINA_OPTS \
> >>              org.apache.catalina.startup.Bootstrap
> >>
> >> ExecStop=/opt/tomcat/latest/bin/jsvc \
> >>              -pidfile ${CATALINA_PID} \
> >>              -stop \
> >>              org.apache.catalina.startup.Bootstrap
> >>
> >> [Install]
> >> WantedBy=multi-user.target
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> Paul Chauvet, CISSP
> >>
> >> Information Security Officer
> >>
> >> State University of New York at New Paltz
> >>
> >> chauvetp@newpaltz.edu
> >>
> >>
> >
> > --
> > Noelette Stout
> > ITS Enterprise Applications - Senior Application Administrator
> > Idaho State University
> > E-mail: stounoel "at" isu "dot" edu
> > Desk: 208-282-2554
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

--
Noelette Stout
ITS Enterprise Applications - Senior Application Administrator
Idaho State University
E-mail: stounoel "at" isu "dot" edu
Desk: 208-282-2554

Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

Posted by Noelette Stout <no...@isu.edu>.
dumb question time -- Is tomcat actually starting up all the way when you
run with systemd? One of the things that I ran into with tomcat and systemd
was that the default service start timeout was not enough time for tomcat
to start. Also, I'm not starting tomcat by calling jsvc directly; I'm using
the daemon.sh script. Here's what one of my tomcat unit files looks like:

[Unit]
Description= CAS server (Tomcat)
After=syslog.target network-online.target

[Service]
Type=forking
User=tomcat
Group=tomcat
Environment=CATALINA_HOME=/var/local/tomcat/tomcat
Environment=CATALINA_BASE=/var/local/tomcat/cas
Environment=JAVA_HOME=/var/local/tomcat/java
ExecStart=/var/local/tomcat/tomcat/bin/daemon.sh start
ExecStop=/var/local/tomcat/tomcat/bin/daemon.sh stop
RemainAfterExit=yes
TimeoutSec=300
[Install]
WantedBy=multi-user.target

I also have a setenv.sh file in $CATALINA_BASE/bin with this (yes, it's a
little redundant):
export JAVA_HOME="/var/local/tomcat/java"
export CATALINA_HOME="/var/local/tomcat/tomcat"
export CATALINA_BASE="/var/local/tomcat/cas"
CATALINA_PID="$CATALINA_BASE/logs/tomcat.pid"
CATALINA_OPTS="-server -Xmx512m -Dlog4j2.formatMsgNoLookups=true"
SERVICE_START_WAIT_TIME=300

I always get a catalina-daemon.out file when starting this way.

On Thu, Aug 11, 2022 at 12:25 PM Paul Chauvet <ch...@newpaltz.edu> wrote:

> Hi Chris,
>
> I honestly don't care if they are in catalina.out, /var/log/messages, or a
> file named 'awesomestuff.log' - I just know that things are MISSING.
>
> Let me be more specific - sorry if I'm not being clear here!
>
>
> Normal operation (running via systemd) - I get Tomcat startup/shutdown,
> and some other info in catalina-YYYY-MM-DD.log.  I don't get the debug
> information for opensaml.
>
> When I start via startup.sh directly - a lot more is being logged to
> catalina.out than anywhere else I have been able to find.
>
>
> I tried starting Tomcat without using systemd by just doing the following
> - but still no catalina.out.
> /opt/tomcat/latest/bin/jsvc \
>             -Dcatalina.home=${CATALINA_HOME} \
>             -Dcatalina.base=${CATALINA_BASE} \
>             -Djava.awt.headless=true \
>
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
>
> -Djava.util.logging.config.file=${CATALINA_BASE}/conf/logging.properties \
>             -Dlog4j2.FormatMsgNoLookups=true \
>             -cp
> ${CATALINA_HOME}/bin/commons-daemon.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar
> \
>             -pidfile ${CATALINA_PID} \
>             -java-home ${JAVA_HOME} \
>             -user tomcat \
>             $CATALINA_OPTS \
>             org.apache.catalina.startup.Bootstrap
>
>
>
> I ended up temporarily just starting via startup.sh just long enough to
> get the error logs I was looking for into catalina.out - then started it up
> again normally.
>
>
> Sorry to bother everyone with this - but I appreciate your assistance!
>
>
> ________________________________
> From: Christopher Schultz <ch...@christopherschultz.net>
> Sent: Thursday, August 11, 2022 1:34 PM
> To: users@tomcat.apache.org <us...@tomcat.apache.org>
> Subject: Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat
> 9.0.63)
>
> CAUTION: Message from a non-New Paltz email server. Treat message, links,
> and attachments with extra caution.
>
>
> Paul,
>
> On 8/11/22 13:03, Paul Chauvet wrote:
> > Hi Noelette,
> >
> > Thanks for the reponse!
> >
> > It logs to catalina-YYYY-MM-DD.log, localhost.YY-MM-DD.log,
> localhost_access_log.YYYY-MM-DD.txt - but it doesn't use catalina.out.
> >
> > When I temporarily started Tomcat via startup.sh it did create
> catalina.out (and start logging the things that it wasn't logging into the
> other files, /var/log/messages, or the systemd journal).
> >
> > I'll see if I can get my setup (at least temporarily) working with
> startup.sh.
>
> OH... you might just be misunderstanding what's happening.
>
> When you use catalina.sh start (or startup.sh), that script just does this:
>
> java [stuff] > ${CATALINA_BASE}/logs/catalina.out 2>&1
>
> When you run with jsvc, it includes some built-in file-rotation and so
> catalina-[date].log is the same thing.
>
> Are you irritated that you can't read the logs, or are you irritated
> that the log file isn't specifically "catalina.out"?
>
> -chris
>
> > ________________________________
> > From: Noelette Stout <no...@isu.edu>
> > Sent: Thursday, August 11, 2022 12:35 PM
> > To: Tomcat Users List <us...@tomcat.apache.org>
> > Subject: Re: Issue with catalina.out not being generated (RHEL 7.9,
> tomcat 9.0.63)
> >
> > CAUTION: Message from a non-New Paltz email server. Treat message,
> links, and attachments with extra caution.
> >
> >
> > We use systemd with jsvc and our tomcat instances write to
> > $CATALINA_BASE/logs by default.
> >
> > On Thu, Aug 11, 2022 at 10:10 AM Paul Chauvet <ch...@newpaltz.edu>
> wrote:
> >
> >> Hello all,
> >>
> >> I haven't been able to figure this out - but a catalina.out file is not
> >> being generated for me.  Sadly - I'm trying to troubleshoot an issue
> (with
> >> a vendor's saml implementation) which wants to write to that file (and
> >> doesn't seem to be writing what I need to catalina.YYYY-DD-MM.logs,
> >> /var/log/messages, or into the journal as seen by "journalctl
> >> --unit=tomcat.service").
> >>
> >>
> >> My environment:
> >>
> >>    *   RHEL 7.9 (though the same happens on my RHEL 8 hosts)
> >>    *   Tomcat 9.0.63 (installed from the .tar.gz download from
> >> https://tomcat.apache.org/download-90.cgi - not from the OS repository)
> >>    *   Using jsvc via a systemd startup script to start Tomcat (that
> script
> >> is at the bottom of this message).
> >>
> >> I've tried specifying CATALINA_OUT in setenv.sh, and in my systemd
> startup
> >> script.  I've temporarily disabled SELinux to see if that makes a
> >> difference.  Neither of those work.  What does work, though I would
> like to
> >> avoid it, is if I start Tomcat via ./startup.sh.  If I do that -
> >> catalina.out is generated but I'm not getting other settings I set in my
> >> systemd script (or having it tied to startup/shutdown of the OS).
> >>
> >> I don't know what I'm missing or doing wrong here, or if there's
> something
> >> about jsvc that is an issue here that I can't figure out.  I've been
> unable
> >> to find anything related to this (lots of posts about catalina.out
> related
> >> to operating system distributed versions of Tomcat that don't appear to
> >> apply).
> >>
> >> Any advice here would be greatly appreciated!
> >>
> >> My systemd startup script is below.
> >>
> >>
> >> [Unit]
> >> Description=Apache Tomcat Web Application Container
> >> After=syslog.target network.target
> >>
> >> [Service]
> >> Type=forking
> >> PIDFile=/var/run/tomcat.pid
> >> UMask=0007
> >>
> >> # Tomcat variables
> >> Environment='JAVA_HOME=/usr/lib/jvm/java-openjdk'
> >> Environment='CATALINA_PID=/var/run/tomcat.pid'
> >> Environment='CATALINA_HOME=/opt/tomcat/latest'
> >> Environment='CATALINA_BASE=/opt/tomcat/latest'
> >> Environment='CATALINA_OPTS=-Xms512M -Xmx2048M -XX:+UseParallelGC
> -server'
> >> Environment='CATALINA_OUT=/var/log/tomcat/catalina.out'
> >>
> >> # Needed to make use of Tomcat Native Library
> >> Environment='LD_LIBRARY_PATH=/opt/tomcat/latest/lib'
> >>
> >> ExecStart=/opt/tomcat/latest/bin/jsvc \
> >>              -Dcatalina.home=${CATALINA_HOME} \
> >>              -Dcatalina.base=${CATALINA_BASE} \
> >>              -Djava.awt.headless=true \
> >>
> >> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
> >>
> >>
> -Djava.util.logging.config.file=${CATALINA_BASE}/conf/logging.properties \
> >>              -Dlog4j2.FormatMsgNoLookups=true \
> >>              -cp
> >>
> ${CATALINA_HOME}/bin/commons-daemon.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar
> >> \
> >>              -pidfile ${CATALINA_PID} \
> >>              -java-home ${JAVA_HOME} \
> >>              -user tomcat \
> >>              $CATALINA_OPTS \
> >>              org.apache.catalina.startup.Bootstrap
> >>
> >> ExecStop=/opt/tomcat/latest/bin/jsvc \
> >>              -pidfile ${CATALINA_PID} \
> >>              -stop \
> >>              org.apache.catalina.startup.Bootstrap
> >>
> >> [Install]
> >> WantedBy=multi-user.target
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> Paul Chauvet, CISSP
> >>
> >> Information Security Officer
> >>
> >> State University of New York at New Paltz
> >>
> >> chauvetp@newpaltz.edu
> >>
> >>
> >
> > --
> > Noelette Stout
> > ITS Enterprise Applications - Senior Application Administrator
> > Idaho State University
> > E-mail: stounoel "at" isu "dot" edu
> > Desk: 208-282-2554
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

-- 
Noelette Stout
ITS Enterprise Applications - Senior Application Administrator
Idaho State University
E-mail: stounoel "at" isu "dot" edu
Desk: 208-282-2554

RE: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

Posted by Hiran CHAUDHURI <hi...@amadeus.com.INVALID>.
CONFIDENTIAL & RESTRICTED

AFAIK catalina.out is just written by redirecting Tomcat's stdout to that file. So if you run Tomcat from any kind of wrapper such as jsvc, what is this going to do to Tomcat's stdout?

See 'Considerations for production usage' on this page: https://tomcat.apache.org/tomcat-9.0-doc/logging.html#Considerations_for_production_usage
As it also states that you end up with two copies of the same messages, you should not be really missing stuff but finding it in a different location.

Hiran

-----Original Message-----
From: Paul Chauvet <ch...@newpaltz.edu>
Sent: Thursday, August 11, 2022 20:25
To: users@tomcat.apache.org
Subject: Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

CAUTION: External mail. Be careful with links and attachments.


Hi Chris,

I honestly don't care if they are in catalina.out, /var/log/messages, or a file named 'awesomestuff.log' - I just know that things are MISSING.

Let me be more specific - sorry if I'm not being clear here!


Normal operation (running via systemd) - I get Tomcat startup/shutdown, and some other info in catalina-YYYY-MM-DD.log.  I don't get the debug information for opensaml.

When I start via startup.sh directly - a lot more is being logged to catalina.out than anywhere else I have been able to find.


I tried starting Tomcat without using systemd by just doing the following - but still no catalina.out.
/opt/tomcat/latest/bin/jsvc \
            -Dcatalina.home=${CATALINA_HOME} \
            -Dcatalina.base=${CATALINA_BASE} \
            -Djava.awt.headless=true \
            -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
            -Djava.util.logging.config.file=${CATALINA_BASE}/conf/logging.properties \
            -Dlog4j2.FormatMsgNoLookups=true \
            -cp ${CATALINA_HOME}/bin/commons-daemon.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar \
            -pidfile ${CATALINA_PID} \
            -java-home ${JAVA_HOME} \
            -user tomcat \
            $CATALINA_OPTS \
            org.apache.catalina.startup.Bootstrap



I ended up temporarily just starting via startup.sh just long enough to get the error logs I was looking for into catalina.out - then started it up again normally.


Sorry to bother everyone with this - but I appreciate your assistance!


________________________________
From: Christopher Schultz <ch...@christopherschultz.net>
Sent: Thursday, August 11, 2022 1:34 PM
To: users@tomcat.apache.org <us...@tomcat.apache.org>
Subject: Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

CAUTION: Message from a non-New Paltz email server. Treat message, links, and attachments with extra caution.


Paul,

On 8/11/22 13:03, Paul Chauvet wrote:
> Hi Noelette,
>
> Thanks for the reponse!
>
> It logs to catalina-YYYY-MM-DD.log, localhost.YY-MM-DD.log, localhost_access_log.YYYY-MM-DD.txt - but it doesn't use catalina.out.
>
> When I temporarily started Tomcat via startup.sh it did create catalina.out (and start logging the things that it wasn't logging into the other files, /var/log/messages, or the systemd journal).
>
> I'll see if I can get my setup (at least temporarily) working with startup.sh.

OH... you might just be misunderstanding what's happening.

When you use catalina.sh start (or startup.sh), that script just does this:

java [stuff] > ${CATALINA_BASE}/logs/catalina.out 2>&1

When you run with jsvc, it includes some built-in file-rotation and so catalina-[date].log is the same thing.

Are you irritated that you can't read the logs, or are you irritated that the log file isn't specifically "catalina.out"?

-chris

> ________________________________
> From: Noelette Stout <no...@isu.edu>
> Sent: Thursday, August 11, 2022 12:35 PM
> To: Tomcat Users List <us...@tomcat.apache.org>
> Subject: Re: Issue with catalina.out not being generated (RHEL 7.9,
> tomcat 9.0.63)
>
> CAUTION: Message from a non-New Paltz email server. Treat message, links, and attachments with extra caution.
>
>
> We use systemd with jsvc and our tomcat instances write to
> $CATALINA_BASE/logs by default.
>
> On Thu, Aug 11, 2022 at 10:10 AM Paul Chauvet <ch...@newpaltz.edu> wrote:
>
>> Hello all,
>>
>> I haven't been able to figure this out - but a catalina.out file is
>> not being generated for me.  Sadly - I'm trying to troubleshoot an
>> issue (with a vendor's saml implementation) which wants to write to
>> that file (and doesn't seem to be writing what I need to
>> catalina.YYYY-DD-MM.logs, /var/log/messages, or into the journal as
>> seen by "journalctl --unit=tomcat.service").
>>
>>
>> My environment:
>>
>>    *   RHEL 7.9 (though the same happens on my RHEL 8 hosts)
>>    *   Tomcat 9.0.63 (installed from the .tar.gz download from
>> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftomcat.apache.org%2Fdownload-90.cgi&amp;data=05%7C01%7C%7C635493c75456451807a508da7bc6d8da%7Cb3f4f7c272ce4192aba4d6c7719b5766%7C0%7C0%7C637958391211683913%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Vs0iZcNhDspIW1INGR8uI7wlXUdpA4ib67vhVolc5e8%3D&amp;reserved=0 - not from the OS repository)
>>    *   Using jsvc via a systemd startup script to start Tomcat (that script
>> is at the bottom of this message).
>>
>> I've tried specifying CATALINA_OUT in setenv.sh, and in my systemd
>> startup script.  I've temporarily disabled SELinux to see if that
>> makes a difference.  Neither of those work.  What does work, though I
>> would like to avoid it, is if I start Tomcat via ./startup.sh.  If I
>> do that - catalina.out is generated but I'm not getting other
>> settings I set in my systemd script (or having it tied to startup/shutdown of the OS).
>>
>> I don't know what I'm missing or doing wrong here, or if there's
>> something about jsvc that is an issue here that I can't figure out.
>> I've been unable to find anything related to this (lots of posts
>> about catalina.out related to operating system distributed versions
>> of Tomcat that don't appear to apply).
>>
>> Any advice here would be greatly appreciated!
>>
>> My systemd startup script is below.
>>
>>
>> [Unit]
>> Description=Apache Tomcat Web Application Container
>> After=syslog.target network.target
>>
>> [Service]
>> Type=forking
>> PIDFile=/var/run/tomcat.pid
>> UMask=0007
>>
>> # Tomcat variables
>> Environment='JAVA_HOME=/usr/lib/jvm/java-openjdk'
>> Environment='CATALINA_PID=/var/run/tomcat.pid'
>> Environment='CATALINA_HOME=/opt/tomcat/latest'
>> Environment='CATALINA_BASE=/opt/tomcat/latest'
>> Environment='CATALINA_OPTS=-Xms512M -Xmx2048M -XX:+UseParallelGC -server'
>> Environment='CATALINA_OUT=/var/log/tomcat/catalina.out'
>>
>> # Needed to make use of Tomcat Native Library
>> Environment='LD_LIBRARY_PATH=/opt/tomcat/latest/lib'
>>
>> ExecStart=/opt/tomcat/latest/bin/jsvc \
>>              -Dcatalina.home=${CATALINA_HOME} \
>>              -Dcatalina.base=${CATALINA_BASE} \
>>              -Djava.awt.headless=true \
>>
>> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
>>
>> -Djava.util.logging.config.file=${CATALINA_BASE}/conf/logging.properties \
>>              -Dlog4j2.FormatMsgNoLookups=true \
>>              -cp
>> ${CATALINA_HOME}/bin/commons-daemon.jar:${CATALINA_HOME}/bin/bootstra
>> p.jar:${CATALINA_HOME}/bin/tomcat-juli.jar
>> \
>>              -pidfile ${CATALINA_PID} \
>>              -java-home ${JAVA_HOME} \
>>              -user tomcat \
>>              $CATALINA_OPTS \
>>              org.apache.catalina.startup.Bootstrap
>>
>> ExecStop=/opt/tomcat/latest/bin/jsvc \
>>              -pidfile ${CATALINA_PID} \
>>              -stop \
>>              org.apache.catalina.startup.Bootstrap
>>
>> [Install]
>> WantedBy=multi-user.target
>>
>>
>>
>>
>>
>>
>>
>> Paul Chauvet, CISSP
>>
>> Information Security Officer
>>
>> State University of New York at New Paltz
>>
>> chauvetp@newpaltz.edu
>>
>>
>
> --
> Noelette Stout
> ITS Enterprise Applications - Senior Application Administrator Idaho
> State University
> E-mail: stounoel "at" isu "dot" edu
> Desk: 208-282-2554
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
IMPORTANT - CONFIDENTIALITY NOTICE - This e-mail is intended only for the use of the individual or entity shown above as addressees . It may contain information which is privileged, confidential or otherwise protected from disclosure under applicable laws . If the reader of this transmission is not the intended recipient, you are hereby notified that any dissemination, printing, distribution, copying, disclosure or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this transmission in error, please immediately notify us by reply e-mail or using the address below and delete the message and any attachments from your system. Amadeus Data Processing GmbH Geschaftsfuhrer: Sven Fuhrmeister Sitz der Gesellschaft: Erding HR Munchen 212770 Berghamer Strasse 6 85435 Erding Germany.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

Posted by Paul Chauvet <ch...@newpaltz.edu>.
Hi Chris,

I honestly don't care if they are in catalina.out, /var/log/messages, or a file named 'awesomestuff.log' - I just know that things are MISSING.

Let me be more specific - sorry if I'm not being clear here!


Normal operation (running via systemd) - I get Tomcat startup/shutdown, and some other info in catalina-YYYY-MM-DD.log.  I don't get the debug information for opensaml.

When I start via startup.sh directly - a lot more is being logged to catalina.out than anywhere else I have been able to find.


I tried starting Tomcat without using systemd by just doing the following - but still no catalina.out.
/opt/tomcat/latest/bin/jsvc \
            -Dcatalina.home=${CATALINA_HOME} \
            -Dcatalina.base=${CATALINA_BASE} \
            -Djava.awt.headless=true \
            -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
            -Djava.util.logging.config.file=${CATALINA_BASE}/conf/logging.properties \
            -Dlog4j2.FormatMsgNoLookups=true \
            -cp ${CATALINA_HOME}/bin/commons-daemon.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar \
            -pidfile ${CATALINA_PID} \
            -java-home ${JAVA_HOME} \
            -user tomcat \
            $CATALINA_OPTS \
            org.apache.catalina.startup.Bootstrap



I ended up temporarily just starting via startup.sh just long enough to get the error logs I was looking for into catalina.out - then started it up again normally.


Sorry to bother everyone with this - but I appreciate your assistance!


________________________________
From: Christopher Schultz <ch...@christopherschultz.net>
Sent: Thursday, August 11, 2022 1:34 PM
To: users@tomcat.apache.org <us...@tomcat.apache.org>
Subject: Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

CAUTION: Message from a non-New Paltz email server. Treat message, links, and attachments with extra caution.


Paul,

On 8/11/22 13:03, Paul Chauvet wrote:
> Hi Noelette,
>
> Thanks for the reponse!
>
> It logs to catalina-YYYY-MM-DD.log, localhost.YY-MM-DD.log, localhost_access_log.YYYY-MM-DD.txt - but it doesn't use catalina.out.
>
> When I temporarily started Tomcat via startup.sh it did create catalina.out (and start logging the things that it wasn't logging into the other files, /var/log/messages, or the systemd journal).
>
> I'll see if I can get my setup (at least temporarily) working with startup.sh.

OH... you might just be misunderstanding what's happening.

When you use catalina.sh start (or startup.sh), that script just does this:

java [stuff] > ${CATALINA_BASE}/logs/catalina.out 2>&1

When you run with jsvc, it includes some built-in file-rotation and so
catalina-[date].log is the same thing.

Are you irritated that you can't read the logs, or are you irritated
that the log file isn't specifically "catalina.out"?

-chris

> ________________________________
> From: Noelette Stout <no...@isu.edu>
> Sent: Thursday, August 11, 2022 12:35 PM
> To: Tomcat Users List <us...@tomcat.apache.org>
> Subject: Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)
>
> CAUTION: Message from a non-New Paltz email server. Treat message, links, and attachments with extra caution.
>
>
> We use systemd with jsvc and our tomcat instances write to
> $CATALINA_BASE/logs by default.
>
> On Thu, Aug 11, 2022 at 10:10 AM Paul Chauvet <ch...@newpaltz.edu> wrote:
>
>> Hello all,
>>
>> I haven't been able to figure this out - but a catalina.out file is not
>> being generated for me.  Sadly - I'm trying to troubleshoot an issue (with
>> a vendor's saml implementation) which wants to write to that file (and
>> doesn't seem to be writing what I need to catalina.YYYY-DD-MM.logs,
>> /var/log/messages, or into the journal as seen by "journalctl
>> --unit=tomcat.service").
>>
>>
>> My environment:
>>
>>    *   RHEL 7.9 (though the same happens on my RHEL 8 hosts)
>>    *   Tomcat 9.0.63 (installed from the .tar.gz download from
>> https://tomcat.apache.org/download-90.cgi - not from the OS repository)
>>    *   Using jsvc via a systemd startup script to start Tomcat (that script
>> is at the bottom of this message).
>>
>> I've tried specifying CATALINA_OUT in setenv.sh, and in my systemd startup
>> script.  I've temporarily disabled SELinux to see if that makes a
>> difference.  Neither of those work.  What does work, though I would like to
>> avoid it, is if I start Tomcat via ./startup.sh.  If I do that -
>> catalina.out is generated but I'm not getting other settings I set in my
>> systemd script (or having it tied to startup/shutdown of the OS).
>>
>> I don't know what I'm missing or doing wrong here, or if there's something
>> about jsvc that is an issue here that I can't figure out.  I've been unable
>> to find anything related to this (lots of posts about catalina.out related
>> to operating system distributed versions of Tomcat that don't appear to
>> apply).
>>
>> Any advice here would be greatly appreciated!
>>
>> My systemd startup script is below.
>>
>>
>> [Unit]
>> Description=Apache Tomcat Web Application Container
>> After=syslog.target network.target
>>
>> [Service]
>> Type=forking
>> PIDFile=/var/run/tomcat.pid
>> UMask=0007
>>
>> # Tomcat variables
>> Environment='JAVA_HOME=/usr/lib/jvm/java-openjdk'
>> Environment='CATALINA_PID=/var/run/tomcat.pid'
>> Environment='CATALINA_HOME=/opt/tomcat/latest'
>> Environment='CATALINA_BASE=/opt/tomcat/latest'
>> Environment='CATALINA_OPTS=-Xms512M -Xmx2048M -XX:+UseParallelGC -server'
>> Environment='CATALINA_OUT=/var/log/tomcat/catalina.out'
>>
>> # Needed to make use of Tomcat Native Library
>> Environment='LD_LIBRARY_PATH=/opt/tomcat/latest/lib'
>>
>> ExecStart=/opt/tomcat/latest/bin/jsvc \
>>              -Dcatalina.home=${CATALINA_HOME} \
>>              -Dcatalina.base=${CATALINA_BASE} \
>>              -Djava.awt.headless=true \
>>
>> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
>>
>> -Djava.util.logging.config.file=${CATALINA_BASE}/conf/logging.properties \
>>              -Dlog4j2.FormatMsgNoLookups=true \
>>              -cp
>> ${CATALINA_HOME}/bin/commons-daemon.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar
>> \
>>              -pidfile ${CATALINA_PID} \
>>              -java-home ${JAVA_HOME} \
>>              -user tomcat \
>>              $CATALINA_OPTS \
>>              org.apache.catalina.startup.Bootstrap
>>
>> ExecStop=/opt/tomcat/latest/bin/jsvc \
>>              -pidfile ${CATALINA_PID} \
>>              -stop \
>>              org.apache.catalina.startup.Bootstrap
>>
>> [Install]
>> WantedBy=multi-user.target
>>
>>
>>
>>
>>
>>
>>
>> Paul Chauvet, CISSP
>>
>> Information Security Officer
>>
>> State University of New York at New Paltz
>>
>> chauvetp@newpaltz.edu
>>
>>
>
> --
> Noelette Stout
> ITS Enterprise Applications - Senior Application Administrator
> Idaho State University
> E-mail: stounoel "at" isu "dot" edu
> Desk: 208-282-2554
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Paul,

On 8/11/22 13:03, Paul Chauvet wrote:
> Hi Noelette,
> 
> Thanks for the reponse!
> 
> It logs to catalina-YYYY-MM-DD.log, localhost.YY-MM-DD.log, localhost_access_log.YYYY-MM-DD.txt - but it doesn't use catalina.out.
> 
> When I temporarily started Tomcat via startup.sh it did create catalina.out (and start logging the things that it wasn't logging into the other files, /var/log/messages, or the systemd journal).
> 
> I'll see if I can get my setup (at least temporarily) working with startup.sh.

OH... you might just be misunderstanding what's happening.

When you use catalina.sh start (or startup.sh), that script just does this:

java [stuff] > ${CATALINA_BASE}/logs/catalina.out 2>&1

When you run with jsvc, it includes some built-in file-rotation and so 
catalina-[date].log is the same thing.

Are you irritated that you can't read the logs, or are you irritated 
that the log file isn't specifically "catalina.out"?

-chris

> ________________________________
> From: Noelette Stout <no...@isu.edu>
> Sent: Thursday, August 11, 2022 12:35 PM
> To: Tomcat Users List <us...@tomcat.apache.org>
> Subject: Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)
> 
> CAUTION: Message from a non-New Paltz email server. Treat message, links, and attachments with extra caution.
> 
> 
> We use systemd with jsvc and our tomcat instances write to
> $CATALINA_BASE/logs by default.
> 
> On Thu, Aug 11, 2022 at 10:10 AM Paul Chauvet <ch...@newpaltz.edu> wrote:
> 
>> Hello all,
>>
>> I haven't been able to figure this out - but a catalina.out file is not
>> being generated for me.  Sadly - I'm trying to troubleshoot an issue (with
>> a vendor's saml implementation) which wants to write to that file (and
>> doesn't seem to be writing what I need to catalina.YYYY-DD-MM.logs,
>> /var/log/messages, or into the journal as seen by "journalctl
>> --unit=tomcat.service").
>>
>>
>> My environment:
>>
>>    *   RHEL 7.9 (though the same happens on my RHEL 8 hosts)
>>    *   Tomcat 9.0.63 (installed from the .tar.gz download from
>> https://tomcat.apache.org/download-90.cgi - not from the OS repository)
>>    *   Using jsvc via a systemd startup script to start Tomcat (that script
>> is at the bottom of this message).
>>
>> I've tried specifying CATALINA_OUT in setenv.sh, and in my systemd startup
>> script.  I've temporarily disabled SELinux to see if that makes a
>> difference.  Neither of those work.  What does work, though I would like to
>> avoid it, is if I start Tomcat via ./startup.sh.  If I do that -
>> catalina.out is generated but I'm not getting other settings I set in my
>> systemd script (or having it tied to startup/shutdown of the OS).
>>
>> I don't know what I'm missing or doing wrong here, or if there's something
>> about jsvc that is an issue here that I can't figure out.  I've been unable
>> to find anything related to this (lots of posts about catalina.out related
>> to operating system distributed versions of Tomcat that don't appear to
>> apply).
>>
>> Any advice here would be greatly appreciated!
>>
>> My systemd startup script is below.
>>
>>
>> [Unit]
>> Description=Apache Tomcat Web Application Container
>> After=syslog.target network.target
>>
>> [Service]
>> Type=forking
>> PIDFile=/var/run/tomcat.pid
>> UMask=0007
>>
>> # Tomcat variables
>> Environment='JAVA_HOME=/usr/lib/jvm/java-openjdk'
>> Environment='CATALINA_PID=/var/run/tomcat.pid'
>> Environment='CATALINA_HOME=/opt/tomcat/latest'
>> Environment='CATALINA_BASE=/opt/tomcat/latest'
>> Environment='CATALINA_OPTS=-Xms512M -Xmx2048M -XX:+UseParallelGC -server'
>> Environment='CATALINA_OUT=/var/log/tomcat/catalina.out'
>>
>> # Needed to make use of Tomcat Native Library
>> Environment='LD_LIBRARY_PATH=/opt/tomcat/latest/lib'
>>
>> ExecStart=/opt/tomcat/latest/bin/jsvc \
>>              -Dcatalina.home=${CATALINA_HOME} \
>>              -Dcatalina.base=${CATALINA_BASE} \
>>              -Djava.awt.headless=true \
>>
>> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
>>
>> -Djava.util.logging.config.file=${CATALINA_BASE}/conf/logging.properties \
>>              -Dlog4j2.FormatMsgNoLookups=true \
>>              -cp
>> ${CATALINA_HOME}/bin/commons-daemon.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar
>> \
>>              -pidfile ${CATALINA_PID} \
>>              -java-home ${JAVA_HOME} \
>>              -user tomcat \
>>              $CATALINA_OPTS \
>>              org.apache.catalina.startup.Bootstrap
>>
>> ExecStop=/opt/tomcat/latest/bin/jsvc \
>>              -pidfile ${CATALINA_PID} \
>>              -stop \
>>              org.apache.catalina.startup.Bootstrap
>>
>> [Install]
>> WantedBy=multi-user.target
>>
>>
>>
>>
>>
>>
>>
>> Paul Chauvet, CISSP
>>
>> Information Security Officer
>>
>> State University of New York at New Paltz
>>
>> chauvetp@newpaltz.edu
>>
>>
> 
> --
> Noelette Stout
> ITS Enterprise Applications - Senior Application Administrator
> Idaho State University
> E-mail: stounoel "at" isu "dot" edu
> Desk: 208-282-2554
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

Posted by Paul Chauvet <ch...@newpaltz.edu>.
Hi Noelette,

Thanks for the reponse!

It logs to catalina-YYYY-MM-DD.log, localhost.YY-MM-DD.log, localhost_access_log.YYYY-MM-DD.txt - but it doesn't use catalina.out.

When I temporarily started Tomcat via startup.sh it did create catalina.out (and start logging the things that it wasn't logging into the other files, /var/log/messages, or the systemd journal).

I'll see if I can get my setup (at least temporarily) working with startup.sh.

________________________________
From: Noelette Stout <no...@isu.edu>
Sent: Thursday, August 11, 2022 12:35 PM
To: Tomcat Users List <us...@tomcat.apache.org>
Subject: Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

CAUTION: Message from a non-New Paltz email server. Treat message, links, and attachments with extra caution.


We use systemd with jsvc and our tomcat instances write to
$CATALINA_BASE/logs by default.

On Thu, Aug 11, 2022 at 10:10 AM Paul Chauvet <ch...@newpaltz.edu> wrote:

> Hello all,
>
> I haven't been able to figure this out - but a catalina.out file is not
> being generated for me.  Sadly - I'm trying to troubleshoot an issue (with
> a vendor's saml implementation) which wants to write to that file (and
> doesn't seem to be writing what I need to catalina.YYYY-DD-MM.logs,
> /var/log/messages, or into the journal as seen by "journalctl
> --unit=tomcat.service").
>
>
> My environment:
>
>   *   RHEL 7.9 (though the same happens on my RHEL 8 hosts)
>   *   Tomcat 9.0.63 (installed from the .tar.gz download from
> https://tomcat.apache.org/download-90.cgi - not from the OS repository)
>   *   Using jsvc via a systemd startup script to start Tomcat (that script
> is at the bottom of this message).
>
> I've tried specifying CATALINA_OUT in setenv.sh, and in my systemd startup
> script.  I've temporarily disabled SELinux to see if that makes a
> difference.  Neither of those work.  What does work, though I would like to
> avoid it, is if I start Tomcat via ./startup.sh.  If I do that -
> catalina.out is generated but I'm not getting other settings I set in my
> systemd script (or having it tied to startup/shutdown of the OS).
>
> I don't know what I'm missing or doing wrong here, or if there's something
> about jsvc that is an issue here that I can't figure out.  I've been unable
> to find anything related to this (lots of posts about catalina.out related
> to operating system distributed versions of Tomcat that don't appear to
> apply).
>
> Any advice here would be greatly appreciated!
>
> My systemd startup script is below.
>
>
> [Unit]
> Description=Apache Tomcat Web Application Container
> After=syslog.target network.target
>
> [Service]
> Type=forking
> PIDFile=/var/run/tomcat.pid
> UMask=0007
>
> # Tomcat variables
> Environment='JAVA_HOME=/usr/lib/jvm/java-openjdk'
> Environment='CATALINA_PID=/var/run/tomcat.pid'
> Environment='CATALINA_HOME=/opt/tomcat/latest'
> Environment='CATALINA_BASE=/opt/tomcat/latest'
> Environment='CATALINA_OPTS=-Xms512M -Xmx2048M -XX:+UseParallelGC -server'
> Environment='CATALINA_OUT=/var/log/tomcat/catalina.out'
>
> # Needed to make use of Tomcat Native Library
> Environment='LD_LIBRARY_PATH=/opt/tomcat/latest/lib'
>
> ExecStart=/opt/tomcat/latest/bin/jsvc \
>             -Dcatalina.home=${CATALINA_HOME} \
>             -Dcatalina.base=${CATALINA_BASE} \
>             -Djava.awt.headless=true \
>
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
>
> -Djava.util.logging.config.file=${CATALINA_BASE}/conf/logging.properties \
>             -Dlog4j2.FormatMsgNoLookups=true \
>             -cp
> ${CATALINA_HOME}/bin/commons-daemon.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar
> \
>             -pidfile ${CATALINA_PID} \
>             -java-home ${JAVA_HOME} \
>             -user tomcat \
>             $CATALINA_OPTS \
>             org.apache.catalina.startup.Bootstrap
>
> ExecStop=/opt/tomcat/latest/bin/jsvc \
>             -pidfile ${CATALINA_PID} \
>             -stop \
>             org.apache.catalina.startup.Bootstrap
>
> [Install]
> WantedBy=multi-user.target
>
>
>
>
>
>
>
> Paul Chauvet, CISSP
>
> Information Security Officer
>
> State University of New York at New Paltz
>
> chauvetp@newpaltz.edu
>
>

--
Noelette Stout
ITS Enterprise Applications - Senior Application Administrator
Idaho State University
E-mail: stounoel "at" isu "dot" edu
Desk: 208-282-2554

Re: Issue with catalina.out not being generated (RHEL 7.9, tomcat 9.0.63)

Posted by Noelette Stout <no...@isu.edu>.
We use systemd with jsvc and our tomcat instances write to
$CATALINA_BASE/logs by default.

On Thu, Aug 11, 2022 at 10:10 AM Paul Chauvet <ch...@newpaltz.edu> wrote:

> Hello all,
>
> I haven't been able to figure this out - but a catalina.out file is not
> being generated for me.  Sadly - I'm trying to troubleshoot an issue (with
> a vendor's saml implementation) which wants to write to that file (and
> doesn't seem to be writing what I need to catalina.YYYY-DD-MM.logs,
> /var/log/messages, or into the journal as seen by "journalctl
> --unit=tomcat.service").
>
>
> My environment:
>
>   *   RHEL 7.9 (though the same happens on my RHEL 8 hosts)
>   *   Tomcat 9.0.63 (installed from the .tar.gz download from
> https://tomcat.apache.org/download-90.cgi - not from the OS repository)
>   *   Using jsvc via a systemd startup script to start Tomcat (that script
> is at the bottom of this message).
>
> I've tried specifying CATALINA_OUT in setenv.sh, and in my systemd startup
> script.  I've temporarily disabled SELinux to see if that makes a
> difference.  Neither of those work.  What does work, though I would like to
> avoid it, is if I start Tomcat via ./startup.sh.  If I do that -
> catalina.out is generated but I'm not getting other settings I set in my
> systemd script (or having it tied to startup/shutdown of the OS).
>
> I don't know what I'm missing or doing wrong here, or if there's something
> about jsvc that is an issue here that I can't figure out.  I've been unable
> to find anything related to this (lots of posts about catalina.out related
> to operating system distributed versions of Tomcat that don't appear to
> apply).
>
> Any advice here would be greatly appreciated!
>
> My systemd startup script is below.
>
>
> [Unit]
> Description=Apache Tomcat Web Application Container
> After=syslog.target network.target
>
> [Service]
> Type=forking
> PIDFile=/var/run/tomcat.pid
> UMask=0007
>
> # Tomcat variables
> Environment='JAVA_HOME=/usr/lib/jvm/java-openjdk'
> Environment='CATALINA_PID=/var/run/tomcat.pid'
> Environment='CATALINA_HOME=/opt/tomcat/latest'
> Environment='CATALINA_BASE=/opt/tomcat/latest'
> Environment='CATALINA_OPTS=-Xms512M -Xmx2048M -XX:+UseParallelGC -server'
> Environment='CATALINA_OUT=/var/log/tomcat/catalina.out'
>
> # Needed to make use of Tomcat Native Library
> Environment='LD_LIBRARY_PATH=/opt/tomcat/latest/lib'
>
> ExecStart=/opt/tomcat/latest/bin/jsvc \
>             -Dcatalina.home=${CATALINA_HOME} \
>             -Dcatalina.base=${CATALINA_BASE} \
>             -Djava.awt.headless=true \
>
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
>
> -Djava.util.logging.config.file=${CATALINA_BASE}/conf/logging.properties \
>             -Dlog4j2.FormatMsgNoLookups=true \
>             -cp
> ${CATALINA_HOME}/bin/commons-daemon.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar
> \
>             -pidfile ${CATALINA_PID} \
>             -java-home ${JAVA_HOME} \
>             -user tomcat \
>             $CATALINA_OPTS \
>             org.apache.catalina.startup.Bootstrap
>
> ExecStop=/opt/tomcat/latest/bin/jsvc \
>             -pidfile ${CATALINA_PID} \
>             -stop \
>             org.apache.catalina.startup.Bootstrap
>
> [Install]
> WantedBy=multi-user.target
>
>
>
>
>
>
>
> Paul Chauvet, CISSP
>
> Information Security Officer
>
> State University of New York at New Paltz
>
> chauvetp@newpaltz.edu
>
>

-- 
Noelette Stout
ITS Enterprise Applications - Senior Application Administrator
Idaho State University
E-mail: stounoel "at" isu "dot" edu
Desk: 208-282-2554