2

I have a tomcat9 server but when trying to deploy I cannot. I would like to view the logs but I am confused about where and how to look.

After searching I came across sites writing about Tomcat's stdout and stderr to syslog, or about /var/log/tomcat9/catalina.out thought it is still confusing.

Can you explain me and provide me a way of viewing the logs?

my tomcat.service file

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

[Service]
Type=forking

Environment=JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-arm64
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'

ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh

User=tomcat
Group=tomcat
UMask=0007
RestartSec=10
Restart=always

[Install]
WantedBy=multi-user.target

Thank you Nick

Woodchuck
  • 3,869
  • 2
  • 39
  • 70
nick
  • 229
  • 2
  • 9
  • Do you have a "logs" directory at the root of your tomcat directory? – Woodchuck Jun 29 '21 at 18:48
  • Unfortunately I made the directories to be non accessible for security reasons. May I set an other directory as a logs directory? – nick Jun 29 '21 at 19:02
  • 2
    The main log is in `/opt/tomcat/logs/catalina..log`. A copy of these message also end up on the standard error, which end up (by default) in systemd journal. – Piotr P. Karwasz Jun 29 '21 at 20:50

0 Answers0