title: log4j2 configuration for weblogic loading hibernate
body: <p>I already have log4j2 working on weblogic, My only propblem is the startup log, while weblogic loading all the hibernate queries there is no configuration yet.</p>
  
  <p>Here are the example from the log:</p>
  
  <pre><code>Listening for transport dt_socket at address: 5005
  &lt;May 23, 2016 2:49:49 PM IDT&gt; &lt;Info&gt; &lt;Security&gt; &lt;BEA-090905&gt; &lt;Disabling the CryptoJ JCE Provider self-integrity check for better startup performance.
  To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.&gt;
  &lt;May 23, 2016 2:49:49 PM IDT&gt; &lt;Info&gt; &lt;Security&gt; &lt;BEA-090906&gt; &lt;Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to FIPS186PRN
  G. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.&gt;
  &lt;May 23, 2016 2:49:50 PM IDT&gt; &lt;Info&gt; &lt;WebLogicServer&gt; &lt;BEA-000377&gt; &lt;Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 24.79-b02
  from Oracle Corporation.&gt;
  &lt;May 23, 2016 2:49:50 PM IDT&gt; &lt;Info&gt; &lt;Management&gt; &lt;BEA-141107&gt; &lt;Version: WebLogic Server 12.1.3.0.0  Wed May 21 18:53:34 PDT 2014 1604337 &gt;
  &lt;May 23, 2016 2:49:52 PM IDT&gt; &lt;Error&gt; &lt;Management&gt; &lt;BEA-141244&gt; &lt;Schema validation errors while parsing C:\work\srv\wls-core.13.5\config\config.xml&lt;47
  :1&gt; - 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.&gt;
  &lt;May 23, 2016 2:49:52 PM IDT&gt; &lt;Error&gt; &lt;Management&gt; &lt;BEA-141244&gt; &lt;Schema validation errors while parsing C:\work\srv\wls-core.13.5\config\config.xml&lt;57
  :1&gt; - 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.&gt;
  &lt;May 23, 2016 2:49:52 PM IDT&gt; &lt;Notice&gt; &lt;WebLogicServer&gt; &lt;BEA-000365&gt; &lt;Server state changed to STARTING.&gt;
  &lt;May 23, 2016 2:49:52 PM IDT&gt; &lt;Info&gt; &lt;WorkManager&gt; &lt;BEA-002900&gt; &lt;Initializing self-tuning thread pool.&gt;
  &lt;May 23, 2016 2:49:52 PM IDT&gt; &lt;Info&gt; &lt;WorkManager&gt; &lt;BEA-002942&gt; &lt;CMM memory level becomes 0. Setting standby thread pool size to 256.&gt;
  &lt;May 23, 2016 2:49:54 PM IDT&gt; &lt;Notice&gt; &lt;Log Management&gt; &lt;BEA-170019&gt; &lt;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.&gt;
  &lt;May 23, 2016 2:49:56 PM IDT&gt; &lt;Notice&gt; &lt;Security&gt; &lt;BEA-090082&gt; &lt;Security initializing using security realm myrealm.&gt;
  &lt;May 23, 2016 2:49:56 PM IDT&gt; &lt;Warning&gt; &lt;Management&gt; &lt;BEA-141277&gt; &lt;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.&gt;
  &lt;May 23, 2016 2:49:56 PM IDT&gt; &lt;Warning&gt; &lt;Store&gt; &lt;BEA-280109&gt; &lt;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.&gt;
  
  &lt;May 23, 2016 2:49:58 PM IDT&gt; &lt;Notice&gt; &lt;WebLogicServer&gt; &lt;BEA-000365&gt; &lt;Server state changed to STANDBY.&gt;
  &lt;May 23, 2016 2:49:58 PM IDT&gt; &lt;Notice&gt; &lt;WebLogicServer&gt; &lt;BEA-000365&gt; &lt;Server state changed to STARTING.&gt;
  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 &lt;clinit&gt;
  INFO: Hibernate Commons Annotations 3.2.0.Final
  May 23, 2016 2:50:05 PM org.hibernate.cfg.Environment &lt;clinit&gt;
  INFO: Hibernate 3.6.10.Final
  May 23, 2016 2:50:05 PM org.hibernate.cfg.Environment &lt;clinit&gt;
  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 &lt;clinit&gt;
  INFO: using JDK 1.4 java.sql.Timestamp handling
  May 23, 2016 2:50:05 PM org.hibernate.ejb.Version &lt;clinit&gt;
  </code></pre>
  
  <p>And only when the server get to the point the application is starting it looks for log4j2.xml and the format changes to ours:</p>
  
  <pre><code>The loading of the configuration:
  INFO: JNDI InitialContext properties:{}
  May 23, 2016 2:51:52 PM org.hibernate.cache.UpdateTimestampsCache &lt;init&gt;
  INFO: starting update timestamps cache at region: org.hibernate.cache.UpdateTimestampsCache
  May 23, 2016 2:51:52 PM org.hibernate.cache.StandardQueryCache &lt;init&gt;
  INFO: starting query cache at region: org.hibernate.cache.StandardQueryCache
  &lt;May 23, 2016 2:52:35 PM IDT&gt; &lt;Warning&gt; &lt;EJB&gt; &lt;BEA-010230&gt; &lt;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.&gt;
  &lt;May 23, 2016 2:52:36 PM IDT&gt; &lt;Warning&gt; &lt;Connector&gt; &lt;BEA-190155&gt; &lt;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 [&lt;resourceadapter-class&gt;] from [META-INF/ra.xml], should implement jav
  a.io.Serializable but does not.&gt;
  May 23, 2016 2:52:39 PM com.idit.framework.rar.mq.server.impl.ActiveMQManagedConnectionFactoryIDIT &lt;init&gt;
  INFO: ActiveMQManagedConnectionFactoryIDIT::Constructor()
  May 23, 2016 2:52:40 PM com.idit.framework.rar.mq.server.impl.ActiveMQConnectionFactoryIDIT &lt;init&gt;
  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'  })
  &lt;May 23, 2016 2:52:40 PM IDT&gt; &lt;Warning&gt; &lt;Weblogic-Validation&gt; &lt;BEA-2156400&gt; &lt;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.&gt;
  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
  </code></pre>
  
  <p>I already tried using "log4j.configurationFile", tried all from the log4j2 official site: <a href="https://logging.apache.org/log4j/2.x/manual/webapp.html" rel="nofollow">log4j2 JEE Application</a>, but still nothing.</p>
  
  <p>My biggest problem is the loading time, we have a lot of hibernate queries and their loading take several minutes for every server startup.</p>
  
  <p>How can I make weblogic load the configuration right on startup?</p>