簡體   English   中英

WebLogic加載休眠的log4j2配置

[英]log4j2 configuration for weblogic loading hibernate

我已經在weblogic上使用過log4j2,我唯一的問題是啟動日志,而weblogic加載所有休眠查詢時還沒有配置。

這是日志中的示例:

Listening for transport dt_socket at address: 5005
<May 23, 2016 2:49:49 PM IDT> <Info> <Security> <BEA-090905> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance.
To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.>
<May 23, 2016 2:49:49 PM IDT> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to FIPS186PRN
G. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.>
<May 23, 2016 2:49:50 PM IDT> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 24.79-b02
from Oracle Corporation.>
<May 23, 2016 2:49:50 PM IDT> <Info> <Management> <BEA-141107> <Version: WebLogic Server 12.1.3.0.0  Wed May 21 18:53:34 PDT 2014 1604337 >
<May 23, 2016 2:49:52 PM IDT> <Error> <Management> <BEA-141244> <Schema validation errors while parsing C:\work\srv\wls-core.13.5\config\config.xml<47
:1> - Expected elements 'administration-protocol@http://xmlns.oracle.com/weblogic/domain wldf-system-resource@http://xmlns.oracle.com/weblogic/domain
jdbc-system-resource@http://xmlns.oracle.com/weblogic/domain saf-agent@http://xmlns.oracle.com/weblogic/domain wlec-connection-pool@http://xmlns.oracl
e.com/weblogic/domain error-handling@http://xmlns.oracle.com/weblogic/domain remote-saf-context@http://xmlns.oracle.com/weblogic/domain migratable-rmi
-service@http://xmlns.oracle.com/weblogic/domain webservice-security@http://xmlns.oracle.com/weblogic/domain jms-connection-consumer@http://xmlns.orac
le.com/weblogic/domain auto-deploy-for-submodules-enabled@http://xmlns.oracle.com/weblogic/domain admin-console@http://xmlns.oracle.com/weblogic/domai
n internal-apps-deploy-on-demand-enabled@http://xmlns.oracle.com/weblogic/domain guardian-enabled@http://xmlns.oracle.com/weblogic/domain ocm-enabled@
http://xmlns.oracle.com/weblogic/domain msg-id-prefix-compatibility-enabled@http://xmlns.oracle.com/weblogic/domain coherence-cluster-system-resource@
http://xmlns.oracle.com/weblogic/domain restful-management-services@http://xmlns.oracle.com/weblogic/domain system-component@http://xmlns.oracle.com/w
eblogic/domain osgi-framework@http://xmlns.oracle.com/weblogic/domain webservice-testpage@http://xmlns.oracle.com/weblogic/domain server-migration-his
tory-size@http://xmlns.oracle.com/weblogic/domain service-migration-history-size@http://xmlns.oracle.com/weblogic/domain coherence-management-cluster@
http://xmlns.oracle.com/weblogic/domain' instead of 'app-deployment@http://xmlns.oracle.com/weblogic/domain' here in element domain@http://xmlns.oracl
e.com/weblogic/domain.>
<May 23, 2016 2:49:52 PM IDT> <Error> <Management> <BEA-141244> <Schema validation errors while parsing C:\work\srv\wls-core.13.5\config\config.xml<57
:1> - Expected elements 'administration-protocol@http://xmlns.oracle.com/weblogic/domain wldf-system-resource@http://xmlns.oracle.com/weblogic/domain
jdbc-system-resource@http://xmlns.oracle.com/weblogic/domain saf-agent@http://xmlns.oracle.com/weblogic/domain wlec-connection-pool@http://xmlns.oracl
e.com/weblogic/domain error-handling@http://xmlns.oracle.com/weblogic/domain remote-saf-context@http://xmlns.oracle.com/weblogic/domain migratable-rmi
-service@http://xmlns.oracle.com/weblogic/domain webservice-security@http://xmlns.oracle.com/weblogic/domain jms-connection-consumer@http://xmlns.orac
le.com/weblogic/domain auto-deploy-for-submodules-enabled@http://xmlns.oracle.com/weblogic/domain admin-console@http://xmlns.oracle.com/weblogic/domai
n internal-apps-deploy-on-demand-enabled@http://xmlns.oracle.com/weblogic/domain guardian-enabled@http://xmlns.oracle.com/weblogic/domain ocm-enabled@
http://xmlns.oracle.com/weblogic/domain msg-id-prefix-compatibility-enabled@http://xmlns.oracle.com/weblogic/domain coherence-cluster-system-resource@
http://xmlns.oracle.com/weblogic/domain restful-management-services@http://xmlns.oracle.com/weblogic/domain system-component@http://xmlns.oracle.com/w
eblogic/domain osgi-framework@http://xmlns.oracle.com/weblogic/domain webservice-testpage@http://xmlns.oracle.com/weblogic/domain server-migration-his
tory-size@http://xmlns.oracle.com/weblogic/domain service-migration-history-size@http://xmlns.oracle.com/weblogic/domain coherence-management-cluster@
http://xmlns.oracle.com/weblogic/domain' instead of 'admin-server-name@http://xmlns.oracle.com/weblogic/domain' here in element domain@http://xmlns.or
acle.com/weblogic/domain.>
<May 23, 2016 2:49:52 PM IDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.>
<May 23, 2016 2:49:52 PM IDT> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool.>
<May 23, 2016 2:49:52 PM IDT> <Info> <WorkManager> <BEA-002942> <CMM memory level becomes 0. Setting standby thread pool size to 256.>
<May 23, 2016 2:49:54 PM IDT> <Notice> <Log Management> <BEA-170019> <The server log file C:\work\srv\wls-core.13.5\servers\AdminServer\logs\AdminServ
er.log is opened. All server side log events will be written to this file.>
<May 23, 2016 2:49:56 PM IDT> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
<May 23, 2016 2:49:56 PM IDT> <Warning> <Management> <BEA-141277> <The JMX MBean PlatformMBeanServerUsed attribute is true, but the Platform MBeanServ
er was created without the hooks for the WebLogic Server security infrastructure. The Platform MBeanServer will not be used and Platform MBeans will n
ot be available using the WebLogic Server Runtime or Domain Runtime MBeanServers. This can occur if Platform MBeanServer system properties or JVM opti
ons (-Dcom.sun.management.jmxremote or JRockit -XManagement) were defined.
 To allow the Platform MBeanServer to be used, either remove the system properties and JVM options or start WebLogic Server with the following system
property:
 -Djavax.management.builder.initial=weblogic.management.jmx.mbeanserver.WLSMBeanServerBuilder
 To eliminate this log error if Platform MBeans do not need to be available when using WebLogic Server, set the PlatformMBeanUsed attribute in the JMX
MBean to false.>
<May 23, 2016 2:49:56 PM IDT> <Warning> <Store> <BEA-280109> <The JVM was unable to load the native wlfileio library for the store "_WLS_AdminServer".
 File and paging stores will continue to function correctly. Specifically, file stores that are configured with a transactionally safe synchronous wri
te policy will continue to operate safely and transactionally but may open with a different write-policy. Other store types may not be able to open.>

<May 23, 2016 2:49:58 PM IDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY.>
<May 23, 2016 2:49:58 PM IDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.>
May 23, 2016 2:49:58 PM weblogic.wsee.WseeCoreMessages logWseeServiceStarting
INFO: The Wsee Service is starting
May 23, 2016 2:50:05 PM org.hibernate.annotations.common.Version <clinit>
INFO: Hibernate Commons Annotations 3.2.0.Final
May 23, 2016 2:50:05 PM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.6.10.Final
May 23, 2016 2:50:05 PM org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
May 23, 2016 2:50:05 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : javassist
May 23, 2016 2:50:05 PM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
May 23, 2016 2:50:05 PM org.hibernate.ejb.Version <clinit>

並且只有當服務器到達應用程序啟動點時,它才會查找log4j2.xml,並且格式更改為我們的格式:

The loading of the configuration:
INFO: JNDI InitialContext properties:{}
May 23, 2016 2:51:52 PM org.hibernate.cache.UpdateTimestampsCache <init>
INFO: starting update timestamps cache at region: org.hibernate.cache.UpdateTimestampsCache
May 23, 2016 2:51:52 PM org.hibernate.cache.StandardQueryCache <init>
INFO: starting query cache at region: org.hibernate.cache.StandardQueryCache
<May 23, 2016 2:52:35 PM IDT> <Warning> <EJB> <BEA-010230> <EJB PolicySessionBean : method name performAllUnderwritingChecks and method name performAl
lUnderWritingChecks are equal under case-insensitive comparison but both methods have declarative security settings. Declarative security checks are c
ase-insensitive.>
<May 23, 2016 2:52:36 PM IDT> <Warning> <Connector> <BEA-190155> <Compliance checking and validation of the resource adapter C:\work\srv\wls-core.13.5
\.\applications\idit-Core-ear\idit-ra.mq-1.0.0.rar resulted in the following warnings:
The class 'org.apache.activemq.ra.ActiveMQResourceAdapter', which is defined as [<resourceadapter-class>] from [META-INF/ra.xml], should implement jav
a.io.Serializable but does not.>
May 23, 2016 2:52:39 PM com.idit.framework.rar.mq.server.impl.ActiveMQManagedConnectionFactoryIDIT <init>
INFO: ActiveMQManagedConnectionFactoryIDIT::Constructor()
May 23, 2016 2:52:40 PM com.idit.framework.rar.mq.server.impl.ActiveMQConnectionFactoryIDIT <init>
INFO: ActiveMQConnectionFactoryIDIT::Constructor(factory=com.idit.framework.rar.mq.server.impl.ActiveMQManagedConnectionFactoryIDIT@375f645f, manager=
weblogic.connector.outbound.ConnectionManagerImpl@6e9f8cd2-java:/idit/ConnectionFactory/general, requestInfo=ActiveMQConnectionRequestInfo{ userName =
 'defaultUser' , serverUrl = 'tcp://DO_NOT_EXIST:6666' , clientid = 'null' , userName = 'defaultUser' , useInboundSession = 'false'  })
<May 23, 2016 2:52:40 PM IDT> <Warning> <Weblogic-Validation> <BEA-2156400> <The validation.xml file, located at file:/C:/work/srv/wls-core.13.5/appli
cations/idit-Core-ear/idit-Core/WEB-INF/validation.xml, does not conform to the JSR 303 specifications.>
2016-05-23 14:52:40,661 [STANDBY] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)' ERROR Unable to access file:/c:/work/srv/wls-c
ore.13.5/file:/$%7Bproject.build.directory%7D/classes/log4j-embedded.xml
2016-05-23 14:52:40,663 [STANDBY] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)' ERROR Unable to access file:/c:/work/srv/wls-c
ore.13.5/file:/$%7Bproject.build.directory%7D/classes/log4j-embedded.xml
[[23-05-16 14:52:40.955] INFO  StrutsInformationEntry - Project properties set to: com.idit.noc.common.NOCProjectProperties
[[23-05-16 14:52:40.955] INFO  StrutsInformationEntry - Project properties set to: com.idit.noc.common.NOCProjectProperties
[[23-05-16 14:52:40.977] INFO  IditStartupController - Entering servlet for the first time.
[[23-05-16 14:52:40.977] INFO  IditStartupController - Start printing system properties:
[[23-05-16 14:52:40.978] INFO  IditStartupController -          java.vendor = Oracle Corporation
[[23-05-16 14:52:40.978] INFO  IditStartupController -          sun.java.launcher = SUN_STANDARD

我已經嘗試使用“ log4j.configurationFile”,從log4j2官方站點進行了全部嘗試: log4j2 JEE Application ,但仍然沒有。

我最大的問題是加載時間,我們有很多休眠查詢,每次服務器啟動時它們的加載都需要幾分鍾。

如何使weblogic在啟動時立即加載配置?

您需要在服務器配置菜單的“ 服務器啟動”選項卡上的“ 參數”窗格中設置-Dlog4j.configuration屬性。 然后,WebLogic將讀取屬性文件。

像這樣:

在此處輸入圖片說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM