You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2021/01/07 12:58:03 UTC
[myfaces-tobago] branch tobago-2.x updated: Use Logback for logging
backend.
This is an automated email from the ASF dual-hosted git repository.
lofwyr pushed a commit to branch tobago-2.x
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
The following commit(s) were added to refs/heads/tobago-2.x by this push:
new 91a26de Use Logback for logging backend.
91a26de is described below
commit 91a26dec8157f45044dd7a5e02d1ff93c79da869
Author: Udo Schnurpfeil <ud...@irian.eu>
AuthorDate: Thu Jan 7 13:52:27 2021 +0100
Use Logback for logging backend.
---
pom.xml | 21 ++++++++--
tobago-example/tobago-example-blank/pom.xml | 29 ++++++++------
.../src/main/resources/log4j2.xml | 34 ----------------
.../src/main/resources/logback.xml | 46 ++++++++++++++++++++++
tobago-example/tobago-example-demo/pom.xml | 23 +++++++----
.../example/demo/PartialReloadController.java | 22 ++++++-----
.../src/main/resources/log4j2.xml | 34 ----------------
.../src/main/resources/logback.xml | 46 ++++++++++++++++++++++
.../main/webapp/content/50-partial/partial.xhtml | 2 +-
tobago-example/tobago-example-sandbox/pom.xml | 29 ++++++++------
.../src/main/resources/log4j2.xml | 34 ----------------
.../src/main/resources/logback.xml | 46 ++++++++++++++++++++++
tobago-example/tobago-example-test/pom.xml | 23 +++++++----
.../src/main/resources/log4j2.xml | 34 ----------------
.../src/main/resources/logback.xml | 46 ++++++++++++++++++++++
15 files changed, 280 insertions(+), 189 deletions(-)
diff --git a/pom.xml b/pom.xml
index 393229a..22e3e8f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -427,6 +427,16 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jul-to-slf4j</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
</dependency>
@@ -447,9 +457,9 @@
<version>${logback.version}</version>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>${slf4j.version}</version>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ <version>${logback.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
@@ -561,6 +571,11 @@
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
diff --git a/tobago-example/tobago-example-blank/pom.xml b/tobago-example/tobago-example-blank/pom.xml
index 935ba4f..dfc18ff 100644
--- a/tobago-example/tobago-example-blank/pom.xml
+++ b/tobago-example/tobago-example-blank/pom.xml
@@ -33,25 +33,30 @@
<dependencies>
<dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-core</artifactId>
- <version>${log4j.version}</version>
- <scope>provided</scope>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-slf4j-impl</artifactId>
- <version>${log4j.version}</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
+ <artifactId>jul-to-slf4j</artifactId>
</dependency>
<dependency>
-
-
- <groupId>javax.servlet.jsp.jstl</groupId>
- <artifactId>javax.servlet.jsp.jstl-api</artifactId>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp.jstl</groupId>
+ <artifactId>javax.servlet.jsp.jstl-api</artifactId>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
diff --git a/tobago-example/tobago-example-blank/src/main/resources/log4j2.xml b/tobago-example/tobago-example-blank/src/main/resources/log4j2.xml
deleted file mode 100644
index 347d7bd..0000000
--- a/tobago-example/tobago-example-blank/src/main/resources/log4j2.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<Configuration>
-
- <Appenders>
- <Console name="Console" target="SYSTEM_OUT">
- <PatternLayout pattern="%d{HH:mm:ss} %-5p %-50.50c:%-20.20M:%-4.4L %m%n"/>
- </Console>
- </Appenders>
-
- <Loggers>
-
- <Logger name="org.apache.myfaces.tobago.example.addressbook" level="debug"/>
-
- <Root level="info">
- <AppenderRef ref="Console"/>
- </Root>
- </Loggers>
-</Configuration>
diff --git a/tobago-example/tobago-example-blank/src/main/resources/logback.xml b/tobago-example/tobago-example-blank/src/main/resources/logback.xml
new file mode 100644
index 0000000..1912d01
--- /dev/null
+++ b/tobago-example/tobago-example-blank/src/main/resources/logback.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<!-- XXX Schema is NOT official from logback -->
+<configuration
+ xmlns="http://ch.qos.logback/xml/ns/logback"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://ch.qos.logback/xml/ns/logback https://raw.github.com/enricopulatzo/logback-XSD/master/src/main/xsd/logback.xsd">
+
+ <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <!-- wide -->
+ <!--<pattern>%date{"yyyy-MM-dd'T'HH:mm:ss,SSSXXX", UTC} %-5level [%-20.20thread] %-50.50logger{50}:%-20.20method:%-4.4line [%mdc] %msg%n</pattern>-->
+ <!-- small -->
+ <pattern>%date{"HH:mm:ss,SSS"} %1level %-20.20logger{20}:%-4.4line %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <logger name="org.apache.myfaces.tobago.example" level="debug"/>
+
+ <!-- Note: The DebugPhaseListener is not activated by default. -->
+ <logger name="org.apache.myfaces.tobago.util.DebugPhaseListener" level="trace"/>
+
+ <!-- Note: Enabled for showing session secret fails, might be useful to find nasty things. -->
+ <logger name="org.apache.myfaces.tobago.lifecycle.SecretPhaseListener" level="debug"/>
+
+ <root level="info">
+ <appender-ref ref="console" />
+ </root>
+</configuration>
diff --git a/tobago-example/tobago-example-demo/pom.xml b/tobago-example/tobago-example-demo/pom.xml
index 5e968cb..f18f714 100644
--- a/tobago-example/tobago-example-demo/pom.xml
+++ b/tobago-example/tobago-example-demo/pom.xml
@@ -117,19 +117,26 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-core</artifactId>
- <version>${log4j.version}</version>
- <scope>provided</scope>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-slf4j-impl</artifactId>
- <version>${log4j.version}</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
+ <artifactId>jul-to-slf4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>oro</groupId>
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/PartialReloadController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/PartialReloadController.java
index 14d5fc8..741d487 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/PartialReloadController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/PartialReloadController.java
@@ -73,7 +73,7 @@ public class PartialReloadController {
return logAndNavigate(null);
}
- public String navigateAction() {
+ public String navigate() {
final FacesContext facesContext = FacesContext.getCurrentInstance();
// in case of both the select control is not processed during lifecycle
@@ -89,34 +89,38 @@ public class PartialReloadController {
navigationState = (NavigationState) expression.getValue(elContext);
}
+ final String outcome;
LOG.info("navigateAction = \"" + navigateAction + "\"");
if (navigateAction == null) {
- return logAndNavigate(null);
+ outcome = logAndNavigate(null);
} else if ("left".equals(navigateAction)) {
AjaxUtils.addAjaxComponent(facesContext, "page:left");
navigateAction = null;
- return logAndNavigate(null);
+ outcome = logAndNavigate(null);
} else if ("right".equals(navigateAction)) {
AjaxUtils.addAjaxComponent(facesContext, "page:right");
navigateAction = null;
- return logAndNavigate(null);
+ outcome = logAndNavigate(null);
} else if ("both".equals(navigateAction)) {
AjaxUtils.addAjaxComponent(facesContext, "page:left");
AjaxUtils.addAjaxComponent(facesContext, "page:right");
navigateAction = null;
- return logAndNavigate(null);
+ outcome = logAndNavigate(null);
} else if ("parent".equals(navigateAction)) {
navigateAction = null;
AjaxUtils.addAjaxComponent(facesContext, "page:parent");
- return logAndNavigate(null);
+ outcome = logAndNavigate(null);
} else if ("prev".equals(navigateAction)) {
navigateAction = null;
- return logAndNavigate(navigationState.gotoPrevious());
+ outcome = logAndNavigate(navigationState.gotoPrevious());
} else if ("next".equals(navigateAction)) {
navigateAction = null;
- return logAndNavigate(navigationState.gotoNext());
+ outcome = logAndNavigate(navigationState.gotoNext());
+ } else {
+ outcome = logAndNavigate(null);
}
- return logAndNavigate(null);
+ LOG.info("result outcome={}", outcome);
+ return outcome;
}
private String logAndNavigate(final String navValue) {
diff --git a/tobago-example/tobago-example-demo/src/main/resources/log4j2.xml b/tobago-example/tobago-example-demo/src/main/resources/log4j2.xml
deleted file mode 100644
index 347d7bd..0000000
--- a/tobago-example/tobago-example-demo/src/main/resources/log4j2.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<Configuration>
-
- <Appenders>
- <Console name="Console" target="SYSTEM_OUT">
- <PatternLayout pattern="%d{HH:mm:ss} %-5p %-50.50c:%-20.20M:%-4.4L %m%n"/>
- </Console>
- </Appenders>
-
- <Loggers>
-
- <Logger name="org.apache.myfaces.tobago.example.addressbook" level="debug"/>
-
- <Root level="info">
- <AppenderRef ref="Console"/>
- </Root>
- </Loggers>
-</Configuration>
diff --git a/tobago-example/tobago-example-demo/src/main/resources/logback.xml b/tobago-example/tobago-example-demo/src/main/resources/logback.xml
new file mode 100644
index 0000000..1912d01
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/resources/logback.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<!-- XXX Schema is NOT official from logback -->
+<configuration
+ xmlns="http://ch.qos.logback/xml/ns/logback"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://ch.qos.logback/xml/ns/logback https://raw.github.com/enricopulatzo/logback-XSD/master/src/main/xsd/logback.xsd">
+
+ <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <!-- wide -->
+ <!--<pattern>%date{"yyyy-MM-dd'T'HH:mm:ss,SSSXXX", UTC} %-5level [%-20.20thread] %-50.50logger{50}:%-20.20method:%-4.4line [%mdc] %msg%n</pattern>-->
+ <!-- small -->
+ <pattern>%date{"HH:mm:ss,SSS"} %1level %-20.20logger{20}:%-4.4line %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <logger name="org.apache.myfaces.tobago.example" level="debug"/>
+
+ <!-- Note: The DebugPhaseListener is not activated by default. -->
+ <logger name="org.apache.myfaces.tobago.util.DebugPhaseListener" level="trace"/>
+
+ <!-- Note: Enabled for showing session secret fails, might be useful to find nasty things. -->
+ <logger name="org.apache.myfaces.tobago.lifecycle.SecretPhaseListener" level="debug"/>
+
+ <root level="info">
+ <appender-ref ref="console" />
+ </root>
+</configuration>
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/50-partial/partial.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/50-partial/partial.xhtml
index a2c64e5..d03c79e 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/50-partial/partial.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/50-partial/partial.xhtml
@@ -120,7 +120,7 @@
<tx:selectOneChoice fieldId="navSelect" value="#{partialReloadController.navigateAction}" label="On Change">
<f:facet name="change">
- <tc:command action="#{partialReloadController.navigateAction}" renderedPartially="navTest :page:header:headerInfo"/>
+ <tc:command action="#{partialReloadController.navigate}" renderedPartially="navTest :page:header:headerInfo"/>
</f:facet>
<f:selectItem itemLabel="Select action" itemValue=""/>
<f:selectItem itemLabel="Reload left" itemValue="left"/>
diff --git a/tobago-example/tobago-example-sandbox/pom.xml b/tobago-example/tobago-example-sandbox/pom.xml
index 710e6ae..aff4d37 100644
--- a/tobago-example/tobago-example-sandbox/pom.xml
+++ b/tobago-example/tobago-example-sandbox/pom.xml
@@ -36,25 +36,30 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-core</artifactId>
- <version>${log4j.version}</version>
- <scope>provided</scope>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-slf4j-impl</artifactId>
- <version>${log4j.version}</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
+ <artifactId>jul-to-slf4j</artifactId>
</dependency>
<dependency>
-
-
- <groupId>javax.servlet.jsp.jstl</groupId>
- <artifactId>javax.servlet.jsp.jstl-api</artifactId>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp.jstl</groupId>
+ <artifactId>javax.servlet.jsp.jstl-api</artifactId>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
diff --git a/tobago-example/tobago-example-sandbox/src/main/resources/log4j2.xml b/tobago-example/tobago-example-sandbox/src/main/resources/log4j2.xml
deleted file mode 100644
index 347d7bd..0000000
--- a/tobago-example/tobago-example-sandbox/src/main/resources/log4j2.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<Configuration>
-
- <Appenders>
- <Console name="Console" target="SYSTEM_OUT">
- <PatternLayout pattern="%d{HH:mm:ss} %-5p %-50.50c:%-20.20M:%-4.4L %m%n"/>
- </Console>
- </Appenders>
-
- <Loggers>
-
- <Logger name="org.apache.myfaces.tobago.example.addressbook" level="debug"/>
-
- <Root level="info">
- <AppenderRef ref="Console"/>
- </Root>
- </Loggers>
-</Configuration>
diff --git a/tobago-example/tobago-example-sandbox/src/main/resources/logback.xml b/tobago-example/tobago-example-sandbox/src/main/resources/logback.xml
new file mode 100644
index 0000000..1912d01
--- /dev/null
+++ b/tobago-example/tobago-example-sandbox/src/main/resources/logback.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<!-- XXX Schema is NOT official from logback -->
+<configuration
+ xmlns="http://ch.qos.logback/xml/ns/logback"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://ch.qos.logback/xml/ns/logback https://raw.github.com/enricopulatzo/logback-XSD/master/src/main/xsd/logback.xsd">
+
+ <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <!-- wide -->
+ <!--<pattern>%date{"yyyy-MM-dd'T'HH:mm:ss,SSSXXX", UTC} %-5level [%-20.20thread] %-50.50logger{50}:%-20.20method:%-4.4line [%mdc] %msg%n</pattern>-->
+ <!-- small -->
+ <pattern>%date{"HH:mm:ss,SSS"} %1level %-20.20logger{20}:%-4.4line %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <logger name="org.apache.myfaces.tobago.example" level="debug"/>
+
+ <!-- Note: The DebugPhaseListener is not activated by default. -->
+ <logger name="org.apache.myfaces.tobago.util.DebugPhaseListener" level="trace"/>
+
+ <!-- Note: Enabled for showing session secret fails, might be useful to find nasty things. -->
+ <logger name="org.apache.myfaces.tobago.lifecycle.SecretPhaseListener" level="debug"/>
+
+ <root level="info">
+ <appender-ref ref="console" />
+ </root>
+</configuration>
diff --git a/tobago-example/tobago-example-test/pom.xml b/tobago-example/tobago-example-test/pom.xml
index 831a1ab..cad1099 100644
--- a/tobago-example/tobago-example-test/pom.xml
+++ b/tobago-example/tobago-example-test/pom.xml
@@ -173,19 +173,26 @@
</dependency>
<!-- END replace tomahawk20 excluded dependencies -->
<dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-core</artifactId>
- <version>${log4j.version}</version>
- <scope>provided</scope>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-slf4j-impl</artifactId>
- <version>${log4j.version}</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
+ <artifactId>jul-to-slf4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>oro</groupId>
diff --git a/tobago-example/tobago-example-test/src/main/resources/log4j2.xml b/tobago-example/tobago-example-test/src/main/resources/log4j2.xml
deleted file mode 100644
index 347d7bd..0000000
--- a/tobago-example/tobago-example-test/src/main/resources/log4j2.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<Configuration>
-
- <Appenders>
- <Console name="Console" target="SYSTEM_OUT">
- <PatternLayout pattern="%d{HH:mm:ss} %-5p %-50.50c:%-20.20M:%-4.4L %m%n"/>
- </Console>
- </Appenders>
-
- <Loggers>
-
- <Logger name="org.apache.myfaces.tobago.example.addressbook" level="debug"/>
-
- <Root level="info">
- <AppenderRef ref="Console"/>
- </Root>
- </Loggers>
-</Configuration>
diff --git a/tobago-example/tobago-example-test/src/main/resources/logback.xml b/tobago-example/tobago-example-test/src/main/resources/logback.xml
new file mode 100644
index 0000000..1912d01
--- /dev/null
+++ b/tobago-example/tobago-example-test/src/main/resources/logback.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<!-- XXX Schema is NOT official from logback -->
+<configuration
+ xmlns="http://ch.qos.logback/xml/ns/logback"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://ch.qos.logback/xml/ns/logback https://raw.github.com/enricopulatzo/logback-XSD/master/src/main/xsd/logback.xsd">
+
+ <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <!-- wide -->
+ <!--<pattern>%date{"yyyy-MM-dd'T'HH:mm:ss,SSSXXX", UTC} %-5level [%-20.20thread] %-50.50logger{50}:%-20.20method:%-4.4line [%mdc] %msg%n</pattern>-->
+ <!-- small -->
+ <pattern>%date{"HH:mm:ss,SSS"} %1level %-20.20logger{20}:%-4.4line %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <logger name="org.apache.myfaces.tobago.example" level="debug"/>
+
+ <!-- Note: The DebugPhaseListener is not activated by default. -->
+ <logger name="org.apache.myfaces.tobago.util.DebugPhaseListener" level="trace"/>
+
+ <!-- Note: Enabled for showing session secret fails, might be useful to find nasty things. -->
+ <logger name="org.apache.myfaces.tobago.lifecycle.SecretPhaseListener" level="debug"/>
+
+ <root level="info">
+ <appender-ref ref="console" />
+ </root>
+</configuration>