# HG changeset patch
# User Javier Armendáriz <javier.armendariz@openbravo.com>
# Date 1544718108 -3600
#      Thu Dec 13 17:21:48 2018 +0100
# Node ID 39857122a54f9f23feee5589b336692e05e653a7
# Parent  ad2f7d3fc905ffad818ac2ddf5e4931f5e7ab411
Fixed issue 39800: Log4j config is not found when shutting down Tomcat.

This error can be avoided by adding a dummy log4j configuration that prints
messages to console in the web application archive classpath. If log4j-web.xml
is not found, this file should be used instead.

diff --git a/WebContent/WEB-INF/classes/log4j2.xml b/WebContent/WEB-INF/classes/log4j2.xml
new file mode 100644
--- /dev/null
+++ b/WebContent/WEB-INF/classes/log4j2.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2018 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+-->
+<!-- Default log4j configuration used when config file defined in web.xml is not found -->
+<!-- (i.e. Tomcat is shutting down and context is being destroyed). This simply shows  -->
+<!-- logs to console with the default format. See <issue> for more details -->
+<Configuration>
+  <Loggers>
+    <Root level="info">
+      <AppenderRef ref="Console"/>
+    </Root>
+  </Loggers>
+
+  <Appenders>
+    <Console name="Console" target="SYSTEM_OUT">
+      <PatternLayout pattern="AAAAAH %d [%t] %-5p %c - %m%n"/>
+    </Console>
+  </Appenders>
+</Configuration>
