gpt4 book ai didi

java - tomcat 8 问题不显示任何调试错误

转载 作者:行者123 更新时间:2023-11-28 22:46:40 25 4
gpt4 key购买 nike

我使用的是 tomcat 8.5.49,我的 logging.properties 如下所示:

handlers = 1catalina.org.apache.juli.FileHandler, \
2localhost.org.apache.juli.FileHandler, \
3manager.org.apache.juli.FileHandler, \
java.util.logging.ConsoleHandler

.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

1catalina.org.apache.juli.FileHandler.level = FINE
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.
1catalina.org.apache.juli.FileHandler.maxDays = 90
1catalina.org.apache.juli.FileHandler.encoding = UTF-8

2localhost.org.apache.juli.FileHandler.level = FINE
2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.FileHandler.prefix = localhost.
2localhost.org.apache.juli.FileHandler.maxDays = 90
2localhost.org.apache.juli.FileHandler.encoding = UTF-8

3manager.org.apache.juli.FileHandler.level = FINE
3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.FileHandler.prefix = manager.
3manager.org.apache.juli.FileHandler.bufferSize = 16384
3manager.org.apache.juli.FileHandler.maxDays = 90
3manager.org.apache.juli.FileHandler.encoding = UTF-8

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.OneLineFormatter
java.util.logging.ConsoleHandler.encoding = UTF-8

############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = \
2localhost.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = \
3manager.org.apache.juli.FileHandler

# For example, set the org.apache.catalina.util.LifecycleBase logger to log
# each component that extends LifecycleBase changing state:
#org.apache.catalina.util.LifecycleBase.level = FINE

我使用以下 bash 脚本启动了 tomcat:

#!/bin/sh
export JAVA_HOME=/home/myuser/jdk1.8.0_221
export PATH=$JAVA_HOME/bin:$PATH
export CATALINA_HOME=/home/myuser/tomcat-8.5
export CATALINA_LOG=/home/myuser/tomcat-8.5/logs
export CATALINA_OUT=$CATALINA_LOG
export CATALINA_OPTS="-Djava.awt.headless=true -Xms256m -Xmx512m -Xss256k -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled"
#export CATALINA_OPTS="-Djava.awt.headless=true -Xms3840m -Xmx5120m -XX:PermSize=256m -XX:MaxPermSize=512m -Xss256k -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled"
export CATALINA_BASE=$CATALINA_HOME
$CATALINA_BASE/bin/startup.sh
date >> /home/myuser/tomcat-8.5/logs/startlog.log

在我的 jsp 上我确实有这样的东西:

<%@ page isErrorPage="true" import="java.io.*, java.lang.*"%>

<%
try{
//some code
}catch(Exception e){
out.println("<div id=\"error\">");
e.printStackTrace(new java.io.PrintWriter(out));
out.println("</div>");
}
%>

在我运行的 JSP 上,它显示:

HTTP 状态 500 – 内部服务器错误

但我无法在 logs/catalina.out 中找到任何要调试的错误日志

请帮忙。谢谢

最佳答案

您是否还检查了 logs/localhost.log?有时,一些 tomcat 错误会出现在本地主机日志中,但不会出现在 catalina 日志中。

关于java - tomcat 8 问题不显示任何调试错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58006690/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com