Skip to content

Commit

Permalink
WICKET-6942 Replace usage of log4j 1.x in tests and wicket-examples w…
Browse files Browse the repository at this point in the history
…ith slf4j-simple

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
  • Loading branch information
martin-g committed Dec 30, 2021
1 parent a971051 commit d365e04
Show file tree
Hide file tree
Showing 29 changed files with 206 additions and 257 deletions.
13 changes: 5 additions & 8 deletions README.md
Expand Up @@ -142,13 +142,10 @@ the src/ folder.

You only need to include the Servlet API (3.1, just for compiling), SLF4J
API and the SLF4J logging implementation you want. You cannot use Wicket
without adding a SLF4J logging implementation to your classpath. Most
people use log4j. If you do, just include slf4j-log4j12.jar on your
classpath to get Wicket to use log4j too. If you want to use
commons-logging or JDK14 logging or something else, please see the SLF4J
site (http://www.slf4j.org/) for more information.
without adding a SLF4J logging implementation to your classpath.
Please see the SLF4J site (http://www.slf4j.org/) for more information.

As the following projects all depend on wicket, they inherit these
As the following projects all depend on wicket, they inherit these
dependencies.

- wicket-velocity:
Expand All @@ -171,8 +168,8 @@ the src/ folder.
Google Guice (https://github.com/google/guice)

- wicket-cdi:
Component Dependency Injection 2.0
(http://cdi-spec.org/)
Component Dependency Injection 2.0
(http://cdi-spec.org/)

- wicket-examples:

Expand Down
16 changes: 0 additions & 16 deletions pom.xml
Expand Up @@ -311,12 +311,6 @@
<artifactId>jakarta.inject-api</artifactId>
<version>${jakarta.inject-api.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
Expand Down Expand Up @@ -547,11 +541,6 @@
<artifactId>slf4j-ext</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand Down Expand Up @@ -700,11 +689,6 @@
<artifactId>jcl-over-slf4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<extensions>
Expand Down
1 change: 0 additions & 1 deletion testing/wicket-threadtest/.tomcatplugin
Expand Up @@ -19,7 +19,6 @@
<webClassPathEntry>M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar</webClassPathEntry>
<webClassPathEntry>M2_REPO/jaxen/jaxen/1.1-beta-8/jaxen-1.1-beta-8.jar</webClassPathEntry>
<webClassPathEntry>M2_REPO/jdom/jdom/1.0/jdom-1.0.jar</webClassPathEntry>
<webClassPathEntry>M2_REPO/log4j/log4j/1.2.13/log4j-1.2.13.jar</webClassPathEntry>
<webClassPathEntry>M2_REPO/nekohtml/nekohtml/0.9.5/nekohtml-0.9.5.jar</webClassPathEntry>
<webClassPathEntry>M2_REPO/org/ccil/cowan/tagsoup/tagsoup/0.9.7/tagsoup-0.9.7.jar</webClassPathEntry>
<webClassPathEntry>M2_REPO/rhino/js/1.6R1/js-1.6R1.jar</webClassPathEntry>
Expand Down
4 changes: 0 additions & 4 deletions testing/wicket-threadtest/pom.xml
Expand Up @@ -75,10 +75,6 @@
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<dependency>
<groupId>org.httpunit</groupId>
<artifactId>httpunit</artifactId>
Expand Down
Expand Up @@ -12,11 +12,14 @@
# 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.
log4j.debug=false

log4j.rootLogger=INFO,Stdout

log4j.appender.Stdout=org.apache.log4j.ConsoleAppender
log4j.appender.Stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.Stdout.layout.conversionPattern=%-5p - %-26.26c{1} - %m\n
org.slf4j.simpleLogger.defaultLogLevel=info
org.slf4j.simpleLogger.showDateTime=true
org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss.SSS
org.slf4j.simpleLogger.showThreadName=true
org.slf4j.simpleLogger.showLogName=true
org.slf4j.simpleLogger.logFile=System.out
org.slf4j.simpleLogger.cacheOutputStream=true
org.slf4j.simpleLogger.levelInBrackets=false

org.slf4j.simpleLogger.log.org.apache.wicket=warn
19 changes: 0 additions & 19 deletions wicket-auth-roles/src/test/java/log4j.properties

This file was deleted.

25 changes: 25 additions & 0 deletions wicket-auth-roles/src/test/java/simplelogger.properties
@@ -0,0 +1,25 @@
# 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.

org.slf4j.simpleLogger.defaultLogLevel=info
org.slf4j.simpleLogger.showDateTime=true
org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss.SSS
org.slf4j.simpleLogger.showThreadName=true
org.slf4j.simpleLogger.showLogName=true
org.slf4j.simpleLogger.logFile=System.out
org.slf4j.simpleLogger.cacheOutputStream=true
org.slf4j.simpleLogger.levelInBrackets=false

org.slf4j.simpleLogger.log.org.apache.wicket=warn
18 changes: 0 additions & 18 deletions wicket-bean-validation/src/test/java/log4j.properties

This file was deleted.

25 changes: 25 additions & 0 deletions wicket-bean-validation/src/test/java/simplelogger.properties
@@ -0,0 +1,25 @@
# 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.

org.slf4j.simpleLogger.defaultLogLevel=info
org.slf4j.simpleLogger.showDateTime=true
org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss.SSS
org.slf4j.simpleLogger.showThreadName=true
org.slf4j.simpleLogger.showLogName=true
org.slf4j.simpleLogger.logFile=System.out
org.slf4j.simpleLogger.cacheOutputStream=true
org.slf4j.simpleLogger.levelInBrackets=false

org.slf4j.simpleLogger.log.org.apache.wicket=warn
4 changes: 2 additions & 2 deletions wicket-core/src/main/java/org/apache/wicket/Component.java
Expand Up @@ -4500,10 +4500,10 @@ public Component add(final Behavior... behaviors)
}

/**
* Gets the currently coupled {@link Behavior}s as a unmodifiable list. Returns an empty list
* Gets the currently coupled {@link Behavior}s as an unmodifiable list. Returns an empty list
* rather than null if there are no behaviors coupled to this component.
*
* @return The currently coupled behaviors as a unmodifiable list
* @return The currently coupled behaviors as an unmodifiable list
*/
public final List<? extends Behavior> getBehaviors()
{
Expand Down
Expand Up @@ -29,7 +29,7 @@

/**
* Default implementation of {@link IPackageResourceGuard}. By default, the extensions 'properties',
* 'class' and 'java' are blocked and files like 'log4j.xml' and 'applicationContext.xml'
* 'class' and 'java' are blocked and also files like 'log4j.xml' and 'applicationContext.xml'
*
* A more secure implementation which by default denies access to any resource is
* {@link SecurePackageResourceGuard}
Expand Down
Expand Up @@ -122,10 +122,10 @@ public String getMessage(String key, Map<String, Object> vars)
{
final FormComponent<T> formComponent = FormComponent.this;

// Use the following log4j config for detailed logging on the property resolution
// process
// log4j.logger.org.apache.wicket.resource.loader=DEBUG
// log4j.logger.org.apache.wicket.Localizer=DEBUG
// Use the following slf4j-simple config for detailed logging
// on the property resolution process
// org.slf4j.simpleLogger.log.org.apache.wicket.resource.loader=DEBUG
// org.slf4j.simpleLogger.log.org.apache.wicket.Localizer=DEBUG

final Localizer localizer = formComponent.getLocalizer();

Expand Down
18 changes: 0 additions & 18 deletions wicket-core/src/test/java/log4j.properties

This file was deleted.

This file was deleted.

Expand Up @@ -30,9 +30,9 @@

/**
*
* Use the following log4j config for detailed logging on the property resolution process
* log4j.logger.org.apache.wicket.resource.loader=DEBUG
* log4j.logger.org.apache.wicket.Localizer=DEBUG
* Use the following slf4j-simple config for detailed logging on the property resolution process
* org.slf4j.simpleLogger.log.org.apache.wicket.resource.loader=DEBUG
* org.slf4j.simpleLogger.log.org.apache.wicket.Localizer=DEBUG
*
* @author Juergen Donnerstag
*/
Expand Down
25 changes: 25 additions & 0 deletions wicket-core/src/test/java/simplelogger.properties
@@ -0,0 +1,25 @@
# 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.

org.slf4j.simpleLogger.defaultLogLevel=info
org.slf4j.simpleLogger.showDateTime=true
org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss.SSS
org.slf4j.simpleLogger.showThreadName=true
org.slf4j.simpleLogger.showLogName=true
org.slf4j.simpleLogger.logFile=System.out
org.slf4j.simpleLogger.cacheOutputStream=true
org.slf4j.simpleLogger.levelInBrackets=false

org.slf4j.simpleLogger.log.org.apache.wicket=warn
2 changes: 0 additions & 2 deletions wicket-examples/.tomcatplugin
Expand Up @@ -28,14 +28,12 @@
<webClassPathEntry>M2_REPO/easymock/easymock/1.2_Java1.3/easymock-1.2_Java1.3.jar</webClassPathEntry>
<webClassPathEntry>M2_REPO/javax/portlet/portlet-api/1.0/portlet-api-1.0.jar</webClassPathEntry>
<webClassPathEntry>M2_REPO/jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev.jar</webClassPathEntry>
<webClassPathEntry>M2_REPO/log4j/log4j/1.2.13/log4j-1.2.13.jar</webClassPathEntry>
<webClassPathEntry>M2_REPO/logkit/logkit/1.0.1/logkit-1.0.1.jar</webClassPathEntry>
<webClassPathEntry>M2_REPO/mx4j/mx4j-tools/3.0.1/mx4j-tools-3.0.1.jar</webClassPathEntry>
<webClassPathEntry>M2_REPO/mx4j/mx4j/3.0.1/mx4j-3.0.1.jar</webClassPathEntry>
<webClassPathEntry>M2_REPO/nekohtml/nekohtml/0.9.1/nekohtml-0.9.1.jar</webClassPathEntry>
<webClassPathEntry>M2_REPO/org/apache/portals/bridges/portals-bridges-common/1.0.3/portals-bridges-common-1.0.3.jar</webClassPathEntry>
<webClassPathEntry>M2_REPO/org/slf4j/slf4j-api/1.4.2/slf4j-api-1.4.2.jar</webClassPathEntry>
<webClassPathEntry>M2_REPO/org/slf4j/slf4j-log4j12/1.4.2/slf4j-log4j12-1.4.2.jar</webClassPathEntry>
<webClassPathEntry>M2_REPO/org/springframework/spring/2.0/spring-2.0.jar</webClassPathEntry>
<webClassPathEntry>M2_REPO/rhino/js/1.5R4.1/js-1.5R4.1.jar</webClassPathEntry>
<webClassPathEntry>M2_REPO/velocity/velocity-dep/1.4/velocity-dep-1.4.jar</webClassPathEntry>
Expand Down

0 comments on commit d365e04

Please sign in to comment.