log4j_init_tomcat.properties 在 SAP Hybris Commerce 2011 上找不到

log4j_init_tomcat.properties not found on SAP Hybris Commerce 2011

最近我们正在尝试升级我们的 hybris 版本,直到 2005 年,一切都很好,但是在 2011 年,我在启动服务器时遇到了这个错误:

ERROR StatusLogger File not found in file system or classpath: log4j_init_tomcat.properties
ERROR StatusLogger Reconfiguration failed: No configuration found for '2f8e39b4' at 'null' in 'null'

那个错误不是阻塞,服务器成功启动,问题是,看起来记录器不是 initialized/detected,我注意到在服务器启动之前,日志比平时少很多。没有记录所有扩展的日志。如果我检查 HAC -> 平台 -> 日志记录,我只有 2 个条目,通常我最多有 22 个条目。

我尝试在 1811、1905 和 2005 上搜索 log4j_init_tomcat.properties(使用 find . -iname log4j_init_tomcat.propertieslocate log4j_init_tomcat.properties),但找不到该文件。

这是 HAC 中的日志记录配置:

启动服务器时的完整日志,然后停止服务器:

Running hybrisPlatform on Tomcat...
--> Wrapper Started as Console
Java Service Wrapper Professional Edition 64-bit 3.5.29
  Copyright (C) 1999-2016 Tanuki Software, Ltd. All Rights Reserved.
    http://wrapper.tanukisoftware.com
  Licensed to SAP SE for hybris Platform

Launching a JVM...
Listening for transport dt_socket at address: 8000
WrapperManager: Initializing...
Jan 18, 2021 4:46:57 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-9001"]
Jan 18, 2021 4:46:57 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Jan 18, 2021 4:46:57 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["https-jsse-nio-9002"]
Jan 18, 2021 4:46:57 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Jan 18, 2021 4:46:57 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-127.0.0.1-8009"]
Jan 18, 2021 4:46:57 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Jan 18, 2021 4:46:57 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 652 ms
Jan 18, 2021 4:46:57 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service [Catalina]
Jan 18, 2021 4:46:57 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.5.57
Jan 18, 2021 4:46:57 PM de.hybris.tomcat.ConfigurableRfc6265CookieProcessor$JuliLogHandler info
INFO: No Same Site cookie config file found at tomcat\bin\sameSiteCookies.properties
Loading additional classes from: [file:/home/hybris/bin/platform/resources/libpatches/spring-web-patch-5.2.9.RELEASE-1.jar]
ERROR StatusLogger File not found in file system or classpath: log4j_init_tomcat.properties
ERROR StatusLogger Reconfiguration failed: No configuration found for '7a217bbe' at 'null' in 'null'
Jan 18, 2021 4:47:00 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Jan 18, 2021 4:47:00 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Jan 18, 2021 4:47:00 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Jan 18, 2021 4:47:00 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Jan 18, 2021 4:47:07 PM de.hybris.platform.solr.controller.commands.StartSolrServersCommand executeCommand
INFO: Starting Solr servers ...
Jan 18, 2021 4:47:07 PM de.hybris.platform.solr.controller.commands.StartSolrServerCommand getSolrServerStatus
INFO: Checking Solr server status for instance [name: default, hostname: localhost, port: 8983, mode: STANDALONE]
Jan 18, 2021 4:47:07 PM de.hybris.platform.solr.controller.commands.StartSolrServerCommand startSolrServer
INFO: Starting Solr server for instance [name: default, hostname: localhost, port: 8983, mode: STANDALONE]
Waiting up to 180 seconds to see Solr running on port 8983 [\]  
Started Solr server on port 8983 (pid=38669). Happy searching!

    
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by ma.glasnost.orika.converter.builtin.CloneableConverter (file:/home/hybris/bin/platform/ext/core/lib/orika-core-1.5.2.jar) to method java.lang.Object.clone()
WARNING: Please consider reporting this to the maintainers of ma.glasnost.orika.converter.builtin.CloneableConverter
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Jan 18, 2021 4:48:45 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:45 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:45 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:45 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:45 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:45 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:45 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:45 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:45 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:46 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'springmvc'
Jan 18, 2021 4:48:46 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'springmvc'
Jan 18, 2021 4:48:46 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'springmvc'
Jan 18, 2021 4:48:46 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'DispatcherServlet'
Jan 18, 2021 4:48:47 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'springmvc'
Jan 18, 2021 4:48:47 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'springmvc'
Jan 18, 2021 4:48:48 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'springmvc-v2'
Jan 18, 2021 4:48:49 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:49 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'DispatcherServlet'
Jan 18, 2021 4:48:50 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'springmvc'
Jan 18, 2021 4:48:50 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:50 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:51 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:51 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:51 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'springmvc'
Jan 18, 2021 4:48:51 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:53 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'springmvc'
Jan 18, 2021 4:48:53 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:54 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:54 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:54 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'springmvc'
Jan 18, 2021 4:48:54 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'DispatcherServlet'
Jan 18, 2021 4:48:54 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:55 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'springmvc'
Jan 18, 2021 4:48:55 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:55 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:55 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'springmvc'
Jan 18, 2021 4:48:55 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Jan 18, 2021 4:48:55 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:56 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'springmvc'
Jan 18, 2021 4:48:56 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'springmvc'
Jan 18, 2021 4:48:58 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Jan 18, 2021 4:48:58 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:48:59 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'springmvc'
Jan 18, 2021 4:48:59 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:49:00 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:49:02 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:49:02 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'DispatcherServlet'
Jan 18, 2021 4:49:02 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Jan 18, 2021 4:49:02 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:49:02 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'springmvc'
Jan 18, 2021 4:49:02 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:49:02 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'DispatcherServlet'
Jan 18, 2021 4:49:03 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'DispatcherServlet'
Jan 18, 2021 4:49:03 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:49:03 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Jan 18, 2021 4:49:03 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 18, 2021 4:49:04 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'springmvc'
Jan 18, 2021 4:49:05 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'DispatcherServlet'
Jan 18, 2021 4:49:06 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'springmvc'
Jan 18, 2021 4:49:08 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet 'DispatcherServlet'
Jan 18, 2021 4:50:09 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-9001"]
Jan 18, 2021 4:50:09 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["https-jsse-nio-9002"]
Jan 18, 2021 4:50:09 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-127.0.0.1-8009"]
Jan 18, 2021 4:50:09 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 191925 ms

^CINT trapped.  Shutting down.
shutting down hybris registry..
Sending stop command to Solr running on port 8983 ... waiting up to 180 seconds to allow Jetty process 38669 to stop gracefully.
ERROR StatusLogger File not found in file system or classpath: log4j_init_tomcat.properties
ERROR StatusLogger Reconfiguration failed: No configuration found for 'Default' at 'null' in 'null'
<-- Wrapper Stopped

Tomcat配置:

java.opts.gc = -XX:+UseG1GC -XX:+UseTLAB -Xlog:gc:${HYBRIS_LOG_DIR}/tomcat/java_gc.log
java.opts.jmx = -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
java.opts.log = -Dlog4j.configurationFile=log4j_init_tomcat.properties
java.opts.dirs = -Dcatalina.base=%CATALINA_BASE% -Dcatalina.home=%CATALINA_HOME% -Djava.io.tempdir=${HYBRIS_TEMP_DIR}
java.opts.enc = -Dfile.encoding=UTF-8
java.opts.oom = -XX:-HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${HYBRIS_LOG_DIR}/tomcat

java.time.zone=-Duser.timezone=Asia/Jakarta
tomcat.generaloptions = -server ${java.opts.mem} ${java.opts.gc} ${java.opts.jmx} ${java.opts.log} ${java.opts.dirs} ${java.opts.enc} ${java.opts.oom} -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false ${java.time.zone}
tomcat.javaoptions=-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false

在哪里可以找到那个文件,文件的内容是什么?

感谢和问候,

Adiputera

找到答案,从 tomcat.generaloptions 中删除 ${java.opts.log} 并将其添加到 tomcat.javaoptions

java.opts.gc = -XX:+UseG1GC -XX:+UseTLAB -Xlog:gc:${HYBRIS_LOG_DIR}/tomcat/java_gc.log
java.opts.jmx = -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
java.opts.log = -Dlog4j.configurationFile=log4j_init_tomcat.properties
java.opts.dirs = -Dcatalina.base=%CATALINA_BASE% -Dcatalina.home=%CATALINA_HOME% -Djava.io.tempdir=${HYBRIS_TEMP_DIR}
java.opts.enc = -Dfile.encoding=UTF-8
java.opts.oom = -XX:-HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${HYBRIS_LOG_DIR}/tomcat

java.time.zone=-Duser.timezone=Asia/Jakarta
tomcat.generaloptions = -server ${java.opts.mem} ${java.opts.gc} ${java.opts.jmx} ${java.opts.dirs} ${java.opts.enc} ${java.opts.oom} -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false ${java.time.zone}
tomcat.javaoptions=-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false ${java.opts.log}