diff --git a/.gitattributes b/.gitattributes index 176a458..bec231c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,16 @@ +# 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. + * text=auto diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..d126a97 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,28 @@ + + +Thanks for your contribution to [Apache Commons](https://commons.apache.org/)! Your help is appreciated! + +Before you push a pull request, review this list: + +- [ ] Read the [contribution guidelines](CONTRIBUTING.md) for this project. +- [ ] Run a successful build using the default [Maven](https://maven.apache.org/) goal with `mvn`; that's `mvn` on the command line by itself. +- [ ] Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. This may not always be possible but is a best-practice. +- [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. +- [ ] Each commit in the pull request should have a meaningful subject line and body. Note that commits might be squashed by a maintainer on merge. diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ec488e0..45cf1ec 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -48,7 +48,7 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 with: persist-credentials: false - - uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 + - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} @@ -57,7 +57,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # 3.27.5 + uses: github/codeql-action/init@dd746615b3b9d728a6a37ca2045b68ca76d4841a # 3.28.8 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -68,7 +68,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # 3.27.5 + uses: github/codeql-action/autobuild@dd746615b3b9d728a6a37ca2045b68ca76d4841a # 3.28.8 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -82,4 +82,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # 3.27.5 + uses: github/codeql-action/analyze@dd746615b3b9d728a6a37ca2045b68ca76d4841a # 3.28.8 diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index fb944e3..d6c6d7b 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -39,7 +39,7 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 + uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 with: distribution: 'temurin' java-version: ${{ matrix.java }} diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index 36a2dbe..a95ea09 100644 --- a/.github/workflows/scorecards-analysis.yml +++ b/.github/workflows/scorecards-analysis.yml @@ -57,13 +57,13 @@ jobs: publish_results: true - name: "Upload artifact" - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # 4.4.3 + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # 4.6.0 with: name: SARIF file path: results.sarif retention-days: 5 - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # 3.27.5 + uses: github/codeql-action/upload-sarif@dd746615b3b9d728a6a37ca2045b68ca76d4841a # 3.28.8 with: sarif_file: results.sarif diff --git a/.gitignore b/.gitignore index 5a2ee8f..104d0a6 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ ### VS Code ### .vscode/ +/.DS_Store diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bc0e81b..4e5f72a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ (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 + https://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, @@ -60,18 +60,21 @@ Making Changes -------------- + Create a _topic branch_ for your isolated work. - * Usually you should base your branch on the `master` branch. + * Usually you should base your branch from the `master` branch. * A good topic branch name can be the JIRA bug ID plus a keyword, e.g. `LOGGING-123-InputStream`. * If you have submitted multiple JIRA issues, try to maintain separate branches and pull requests. + Make commits of logical units. * Make sure your commit messages are meaningful and in the proper format. Your commit message should contain the key of the JIRA issue. - * e.g. `LOGGING-123: Close input stream earlier` + * For example, `[LOGGING-123] Close input stream sooner` + Respect the original code style: - + Only use spaces for indentation. + + Only use spaces for indentation; you can check for unnecessary whitespace with `git diff` before committing. + Create minimal diffs - disable _On Save_ actions like _Reformat Source Code_ or _Organize Imports_. If you feel the source code should be reformatted create a separate PR for this change first. - + Check for unnecessary whitespace with `git diff` -- check before committing. -+ Make sure you have added the necessary tests for your changes, typically in `src/test/java`. -+ Run all the tests with `mvn clean verify` to ensure nothing else was accidentally broken. ++ Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. This may not always be possible but is a best-practice. +Unit tests are typically in the `src/test/java` directory. ++ Run a successful build using the default [Maven](https://maven.apache.org/) goal with `mvn`; that's `mvn` on the command line by itself. ++ Write a pull request description that is detailed enough to understand what the pull request does, how, and why. ++ Each commit in the pull request should have a meaningful subject line and body. Note that commits might be squashed by a maintainer on merge. + Making Trivial Changes ---------------------- @@ -79,7 +82,7 @@ Making Trivial Changes The JIRA tickets are used to generate the changelog for the next release. For changes of a trivial nature to comments and documentation, it is not always necessary to create a new ticket in JIRA. -In this case, it is appropriate to start the first line of a commit with '(doc)' instead of a ticket number. +In this case, it is appropriate to start the first line of a commit with '[doc]' or '[javadoc]' instead of a ticket number. Submitting Changes diff --git a/NOTICE.txt b/NOTICE.txt index e4c01a1..d681578 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1,5 +1,5 @@ Apache Commons Logging -Copyright 2001-2024 The Apache Software Foundation +Copyright 2001-2025 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (https://www.apache.org/). diff --git a/PROPOSAL.html b/PROPOSAL.html index 395071e..625a977 100644 --- a/PROPOSAL.html +++ b/PROPOSAL.html @@ -21,7 +21,7 @@ Proposal for Logging Library Package - +

Proposal for Logging Package

diff --git a/README.md b/README.md index 2e49443..e19a542 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ (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 + https://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, diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 40c5098..18d43be 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -12,6 +12,47 @@ Changes in this version ----------------------- +Fixed Bugs +---------- + +* Javadoc is missing its Overview page. Thanks to Gary Gregory. +* Remove -nouses directive from maven-bundle-plugin. OSGi package imports now state 'uses' definitions for package imports, this doesn't affect JPMS (from org.apache.commons:commons-parent:80). Thanks to Gary Gregory. + +Changes +------- + +* Bump org.apache.commons:commons-parent from 72 to 81 #285, #287, #295, #298, #303, #310, #339. Thanks to Gary Gregory, Dependabot. +* Bump org.apache.commons:commons-lang3 from 3.16.0 to 3.17.0 #288 [test]. Thanks to Gary Gregory, Dependabot. +* Bump log4j2.version from 2.23.1 to 2.24.3 #292, #299, #319, #328. Thanks to Gary Gregory, Dependabot. + +Removed: +* Remove "cobertura" plugin, we use JaCoco, Cobertura is unmaintained. Thanks to Gary Gregory. + +Historical list of changes: https://commons.apache.org/proper/commons-logging/changes.html + +Download it from https://commons.apache.org/proper/commons-logging/download_logging.cgi + +For complete information on Apache Commons Logging, including instructions on how to submit bug reports, +patches, or suggestions for improvement, see the Apache Commons Logging website: + +https://commons.apache.org/proper/commons-logging/ + +----------------------------------------------------------------------------- + +Apache Commons Logging 1.3.5 Release Notes +------------------------------------------ + +The Apache Commons Logging team is pleased to announce the release of Apache Commons Logging 1.3.5. + +Apache Commons Logging is a thin adapter allowing configurable bridging to other, +well-known logging systems. + +This is a feature and maintenance release. Java 8 or later is required. + +Changes in this version +----------------------- + + Changes ------- @@ -50,7 +91,7 @@ Changes in this version Fixed Bugs ---------- -* LOGGING-192: Fix factory loading from context class loader #280, #281. Thanks to Bjrn Kautler, Piotr Karwasz. +* LOGGING-192: Fix factory loading from context class loader #280, #281. Thanks to Bj�rn Kautler, Piotr Karwasz. Changes ------- @@ -166,9 +207,9 @@ Fixed Bugs * Remove references to very old JDK and Commons Logging versions #201. Thanks to Elliotte Rusty Harold. * Update from Logj 1 to the Log4j 2 API compatibility layer #231. Thanks to Gary Gregory, Piotr P. Karwasz. -* Allow Servlet 4 in OSGi environment #191. Thanks to Vclav Haisman. +* Allow Servlet 4 in OSGi environment #191. Thanks to V�clav Haisman. * Fix generics warnings #213. Thanks to Elliotte Rusty Harold. -* LOGGING-189: Fix Import-Package entry for org.slf4j #188. Thanks to Vclav Haisman, Sebb, Hannes Wellmann, Gary Gregory, Piotr P. Karwasz. +* LOGGING-189: Fix Import-Package entry for org.slf4j #188. Thanks to V�clav Haisman, Sebb, Hannes Wellmann, Gary Gregory, Piotr P. Karwasz. Changes ------- diff --git a/STATUS.html b/STATUS.html index 2726ce1..272223d 100644 --- a/STATUS.html +++ b/STATUS.html @@ -21,21 +21,21 @@ Status File for Apache Commons "Logging" Component - + - -
+

The Apache Commons Logging Component

-[Introduction] -[Dependencies] -[Release Info] -[Committers] -[Action Items] -

+
    +
  1. Introduction
  2. +
  3. Dependencies
  4. +
  5. Release Info
  6. +
  7. Committers
  8. +
  9. Action Items
  10. +
- +

1. INTRODUCTION

@@ -54,6 +54,7 @@ developer to not tie himself to a particular logging implementation.

The package does : +

-

Non-goals: +

-

- - +

2. DEPENDENCIES

The Logging component is dependent upon the following external @@ -99,7 +98,7 @@ components for compilation:

Of course, the user must ensure that any logging systems that they wish to use are present in the classpath when they use this component.

- +

3. RELEASE INFO

@@ -133,9 +132,7 @@ to use are present in the classpath when they use this component.

Planned Next Release: TBD

- - - +

4. COMMITTERS

The following individuals are the primary developers and maintainers of this @@ -154,11 +151,10 @@ component to ensure that it continues to meet a variety of needs.

  • Juozas Baliuka
  • - - +

    5. ACTION ITEMS

    -

    TO DO List:

    +

    TO DO List: Empty.

    diff --git a/pom.xml b/pom.xml index 84468ce..b078759 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - + - RC1 + RC2 true 3.2.1 filesystem - 2.24.2 + 2.24.3 1.3.14 2.0.16 1.13.0 @@ -71,7 +71,8 @@ under the License. org.slf4j;version="[1.7, 3)";resolution:=optional, org.slf4j.spi;version="[1.7, 3)";resolution:=optional - 2024-11-22T15:35:19Z + + 2024-08-19T13:43:35Z true 0.42 @@ -758,7 +759,7 @@ under the License. ggregory at apache.org https://www.garygregory.com The Apache Software Foundation - https://www.apache.org/ + https://www.apache.org/ PMC Member diff --git a/src/changes/changes.xml b/src/changes/changes.xml index ed14b16..e09841c 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -38,18 +38,22 @@ and commit The type attribute can be add,update,fix,remove. --> - + Release Notes - + + Javadoc is missing its Overview page. + Remove -nouses directive from maven-bundle-plugin. OSGi package imports now state 'uses' definitions for package imports, this doesn't affect JPMS (from org.apache.commons:commons-parent:80). - Bump org.apache.commons:commons-parent from 72 to 78 #285, #287, #295, #298, #303, #310. + Bump org.apache.commons:commons-parent from 72 to 81 #285, #287, #295, #298, #303, #310, #339. Bump org.apache.commons:commons-lang3 from 3.16.0 to 3.17.0 #288 [test]. - Bump log4j2.version from 2.23.1 to 2.24.2 #292, #299, #319. + Bump log4j2.version from 2.23.1 to 2.24.3 #292, #299, #319, #328. Remove "cobertura" plugin, we use JaCoco, Cobertura is unmaintained. diff --git a/src/changes/release-notes.vm b/src/changes/release-notes.vm index f8cb8e8..3fb22ca 100644 --- a/src/changes/release-notes.vm +++ b/src/changes/release-notes.vm @@ -107,7 +107,7 @@ Removed: ## End of main loop #end -Historical list of changes: ${project.url}changes-report.html +Historical list of changes: ${project.url}changes.html Download it from ${project.url}download_logging.cgi diff --git a/src/conf/checkstyle.xml b/src/conf/checkstyle.xml index 163b762..7ae8919 100644 --- a/src/conf/checkstyle.xml +++ b/src/conf/checkstyle.xml @@ -72,5 +72,6 @@ limitations under the License. + diff --git a/src/conf/pmd.xml b/src/conf/pmd.xml index 9aab35a..f8d0ed4 100644 --- a/src/conf/pmd.xml +++ b/src/conf/pmd.xml @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. --> + xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.net/ruleset_2_0_0.xsd"> Excludes from default PMD rules. diff --git a/src/main/assembly/bin.xml b/src/main/assembly/bin.xml index 2cc4fe3..baa1ccc 100644 --- a/src/main/assembly/bin.xml +++ b/src/main/assembly/bin.xml @@ -19,7 +19,7 @@ under the License. --> + xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 https://maven.apache.org/xsd/assembly-2.2.0.xsd"> bin tar.gz diff --git a/src/main/assembly/src.xml b/src/main/assembly/src.xml index 0315bac..8ea6fb3 100644 --- a/src/main/assembly/src.xml +++ b/src/main/assembly/src.xml @@ -19,7 +19,7 @@ under the License. --> + xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 https://maven.apache.org/xsd/assembly-2.2.0.xsd"> src tar.gz diff --git a/src/main/java/org/apache/commons/logging/LogFactory.java b/src/main/java/org/apache/commons/logging/LogFactory.java index bfec5d9..f4253a8 100644 --- a/src/main/java/org/apache/commons/logging/LogFactory.java +++ b/src/main/java/org/apache/commons/logging/LogFactory.java @@ -566,7 +566,6 @@ public abstract class LogFactory { * * @param clazz Class. * @return a ClassLoader. - * * @since 1.1 */ protected static ClassLoader getClassLoader(final Class clazz) { @@ -886,7 +885,7 @@ public abstract class LogFactory { // implementations via the TCCL, we don't try to load the default LogFactory // implementation via the context class loader because: // * that can cause problems (see comments in newFactory method) - // * no-one should be customising the code of the default class + // * no-one should be customizing the code of the default class // Yes, we do give up the ability for the child to ship a newer // version of the LogFactoryImpl class and have it used dynamically // by an old LogFactory class in the parent, but that isn't diff --git a/src/main/java/org/apache/commons/logging/impl/LogFactoryImpl.java b/src/main/java/org/apache/commons/logging/impl/LogFactoryImpl.java index bcaec92..eeb6845 100644 --- a/src/main/java/org/apache/commons/logging/impl/LogFactoryImpl.java +++ b/src/main/java/org/apache/commons/logging/impl/LogFactoryImpl.java @@ -490,7 +490,6 @@ public class LogFactoryImpl extends LogFactory { * Follows the discovery process described in the class Javadoc. * * @param logCategory the name of the log category - * * @throws LogConfigurationException if an error in discovery occurs, * or if no adapter at all can be instantiated */ @@ -809,7 +808,6 @@ public class LogFactoryImpl extends LogFactory { * call {@code getInstance(String)} with it. * * @param clazz Class for which a suitable Log name will be derived - * * @throws LogConfigurationException if a suitable {@code Log} * instance cannot be returned */ @@ -866,9 +864,7 @@ public class LogFactoryImpl extends LogFactory { *

    * * @return the {@code Constructor} that can be called to instantiate new {@link org.apache.commons.logging.Log} instances. - * * @throws LogConfigurationException if a suitable constructor cannot be returned - * * @deprecated Never invoked by this class; subclasses should not assume it will be. */ @Deprecated @@ -888,10 +884,9 @@ public class LogFactoryImpl extends LogFactory { /** * Given two related class loaders, return the one which is a child of * the other. - *

    + * * @param c1 is a class loader (including the null class loader) * @param c2 is a class loader (including the null class loader) - * * @return c1 if it has c2 as an ancestor, c2 if it has c1 as an ancestor, * and null if neither is an ancestor of the other. */ @@ -956,7 +951,6 @@ public class LogFactoryImpl extends LogFactory { * @param logAdapterClassName is the class name of the Log implementation * that could not be instantiated. Cannot be {@code null}. * @param discoveryFlaw is the Throwable created by the class loader - * * @throws LogConfigurationException ALWAYS */ private void handleFlawedDiscovery(final String logAdapterClassName, @@ -1191,7 +1185,6 @@ public class LogFactoryImpl extends LogFactory { * which is required by Jdk14Logger. * * @return Whether JDK 1.4 or later logging is available. - * * @deprecated Never invoked by this class; subclasses should not assume it will be. */ @Deprecated @@ -1203,7 +1196,6 @@ public class LogFactoryImpl extends LogFactory { * Tests whether a Log4J implementation available. * * @return whether a Log4J implementation available. - * * @deprecated Never invoked by this class; subclasses should not assume it will be. */ @Deprecated @@ -1262,7 +1254,6 @@ public class LogFactoryImpl extends LogFactory { * * @param name Name of the new logger * @return a new {@link org.apache.commons.logging.Log} - * * @throws LogConfigurationException if a new instance cannot be created */ protected Log newInstance(final String name) throws LogConfigurationException { diff --git a/src/main/java/overview.html b/src/main/javadoc/overview.html similarity index 98% rename from src/main/java/overview.html rename to src/main/javadoc/overview.html index 4fc581b..afafc63 100644 --- a/src/main/java/overview.html +++ b/src/main/javadoc/overview.html @@ -21,7 +21,7 @@ Overview Documentation for COMMONS-LOGGING - +

    The Logging Wrapper Library component of the Apache Commons subproject offers wrappers around an extensible set of concrete logging implementations, so that application code based on it does not need to be diff --git a/src/site/resources/profile.jacoco b/src/site/resources/profile.jacoco index e69de29..0314c63 100644 --- a/src/site/resources/profile.jacoco +++ b/src/site/resources/profile.jacoco @@ -0,0 +1,16 @@ +// 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 +// +// https://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. diff --git a/src/site/site.xml b/src/site/site.xml index d53d2dd..72b61fe 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -17,30 +17,39 @@ limitations under the License. --> - - - Commons Logging - /images/logo.png - https://commons.apache.org/logging/ + + +

    - + + + + + + + + + + + + + + + + - - - - - - - + -
    + diff --git a/src/site/xdoc/building.xml b/src/site/xdoc/building.xml index c2805a2..f0cb8b4 100644 --- a/src/site/xdoc/building.xml +++ b/src/site/xdoc/building.xml @@ -15,7 +15,9 @@ 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. --> - + Building Commons Documentation Team diff --git a/src/site/xdoc/download_logging.xml b/src/site/xdoc/download_logging.xml index aac6134..eaef63f 100644 --- a/src/site/xdoc/download_logging.xml +++ b/src/site/xdoc/download_logging.xml @@ -7,7 +7,7 @@ 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 + https://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, @@ -56,10 +56,12 @@ limitations under the License. | | +======================================================================+ --> - + Download Apache Commons Logging - Apache Commons Documentation Team + Apache Commons Team
    @@ -79,7 +81,7 @@ limitations under the License. mirrors (at the end of the mirrors list) that should be available.

    - [if-any logo][end] + [if-any logo]Logo[end]

    diff --git a/src/site/xdoc/guide.xml b/src/site/xdoc/guide.xml index 469ef75..2f7a7f4 100644 --- a/src/site/xdoc/guide.xml +++ b/src/site/xdoc/guide.xml @@ -19,8 +19,9 @@ --> - - + User Guide Commons Documentation Team @@ -28,7 +29,6 @@
    -

    1. Introduction
    2. Quick Start @@ -85,7 +85,6 @@
    3. Frequently Asked Questions
    -

    @@ -228,18 +227,16 @@ is responsible for handling such issues.

    -

    +

    To use the JCL SPI from a Java class, include the following import statements: -

    -
      - +

      + import org.apache.commons.logging.Log;
      import org.apache.commons.logging.LogFactory;
      -

    Note that some components using JCL may either extend Log, @@ -251,7 +248,6 @@ on how commons-logging should be used in such components. For each class definition, declare and initialize a log attribute as follows:

    -
      public class CLASS { @@ -259,7 +255,6 @@ public class CLASS ... ; -

    Note that for application code, declaring the log member as "static" is more efficient as one Log object is created per class, and is recommended. @@ -278,7 +273,6 @@ The org.apache.commons.logging.Log interface defines the following methods for use in writing log/trace messages to the log:

    -
      log.fatal(Object message); log.fatal(Object message, Throwable t); @@ -293,7 +287,6 @@ in writing log/trace messages to the log: log.trace(Object message); log.trace(Object message, Throwable t); -

    Semantics for these methods are such that it is expected that the severity, from highest to lowest, of messages is ordered as above. @@ -301,7 +294,6 @@ that the severity, from highest to lowest, of messages is ordered as above.

    In addition to the logging methods, the following are provided for code guards:

    -
      log.isFatalEnabled(); log.isErrorEnabled(); @@ -310,7 +302,6 @@ In addition to the logging methods, the following are provided for code guards: log.isDebugEnabled(); log.isTraceEnabled(); -

    Prior to release 1.0.4, none of the standard Log implementations were @@ -434,13 +425,13 @@ The following guidelines are suggested:

  • fatal - Severe errors that cause premature termination. Expect these to be immediately visible on a status console. -See also +See also Internationalization.
  • error - Other runtime errors or unexpected conditions. Expect these to be immediately visible on a status console. -See also +See also Internationalization.
  • @@ -448,14 +439,14 @@ Internationalization. other runtime situations that are undesirable or unexpected, but not necessarily "wrong". Expect these to be immediately visible on a status console. -See also +See also Internationalization.
  • info - Interesting runtime events (startup/shutdown). Expect these to be immediately visible on a console, so be conservative and keep to a minimum. -See also +See also Internationalization.
  • @@ -561,11 +552,9 @@ If more control is desired for the level of detail of these 'enterprise' exceptions, then consider creating a special logger just for these exceptions:

    -
      Log log = LogFactory.getLog("org.apache.component.enterprise"); -

    This allows the 'enterprise' level information to be turned on/off explicitly by most logger implementations. @@ -669,29 +658,29 @@ new LogFactory implementations that provide alternative discovery s When creating new implementations for Log and LogFactory, it is important to understand the implied contract between the factory and the log implementations: -

      -
    • Life cycle -
      +

      +
        +
      • Life cycle +
        The JCL LogFactory implementation must assume responsibility for either connecting/disconnecting to a logging toolkit, or instantiating/initializing/destroying a logging toolkit. -
        +
    • -
    • Exception handling -
      +
    • Exception handling +
      The JCL Log interface doesn't specify any exceptions to be handled, the implementation must catch any exceptions.
    • -
    • Multiple threads -
      +
    • Multiple threads +
      The JCL Log and LogFactory implementations must ensure that any synchronization required by the logging toolkit is met.
    -

    diff --git a/src/site/xdoc/index.xml b/src/site/xdoc/index.xml index 43a1c02..8a56f2e 100644 --- a/src/site/xdoc/index.xml +++ b/src/site/xdoc/index.xml @@ -19,8 +19,9 @@ --> - - + Overview Commons Documentation Team @@ -82,23 +83,23 @@ This gives short introductions to topics such as advanced class loading. here.

    - The full release history is here. + The full release history is here.

    - See change-report. + See change-report.

    The main purpose of the 1.2 release is to drop support for Java 1.1.

    For a full list of changes since the 1.1.3 release, please refer to the - change-report.

    + change-report.

    The 1.1.3 release only updates the Bundle-SymbolicName in the manifest to "org.apache.commons.logging".

    For a full list of changes since the 1.1.1 release, please refer to the - change-report.

    + change-report.

    The 1.1.2 release is a packaging of bug fixes since release 1.1.1.

    diff --git a/src/site/xdoc/issue-tracking.xml b/src/site/xdoc/issue-tracking.xml index 4eea72f..f595a41 100644 --- a/src/site/xdoc/issue-tracking.xml +++ b/src/site/xdoc/issue-tracking.xml @@ -7,7 +7,7 @@ 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 + https://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, @@ -41,10 +41,12 @@ limitations under the License. | | +======================================================================+ --> - + Apache Commons Logging Issue tracking - Apache Commons Documentation Team + Apache Commons Team @@ -64,6 +66,7 @@ limitations under the License.

    If you would like to report a bug, or raise an enhancement request with Apache Commons Logging please do the following: +

    1. Search existing open bugs. If you find your issue listed then please add a comment with your details.
    2. @@ -73,16 +76,15 @@ limitations under the License.
    3. Submit either a bug report or enhancement request.
    -

    Please also remember these points: +

    • the more information you provide, the better we can help you
    • test cases are vital, particularly for any proposed enhancements
    • the developers of Apache Commons Logging are all unpaid volunteers
    -

    For more information on creating patches see the @@ -91,12 +93,12 @@ limitations under the License.

    You may also find these links useful: +

    -

  • diff --git a/src/site/xdoc/junit-report.xml b/src/site/xdoc/junit-report.xml index f48dcd9..63edf44 100644 --- a/src/site/xdoc/junit-report.xml +++ b/src/site/xdoc/junit-report.xml @@ -15,8 +15,9 @@ 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. --> - - + JUnit Test Results Commons Documentation Team diff --git a/src/site/xdoc/mail-lists.xml b/src/site/xdoc/mail-lists.xml index 01fdacc..72e710a 100644 --- a/src/site/xdoc/mail-lists.xml +++ b/src/site/xdoc/mail-lists.xml @@ -7,7 +7,7 @@ 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 + https://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, @@ -39,10 +39,12 @@ limitations under the License. | | +======================================================================+ --> - + Apache Commons Logging Mailing Lists - Apache Commons Documentation Team + Apache Commons Team @@ -53,10 +55,10 @@ limitations under the License. To make it easier for people to only read messages related to components they are interested in, the convention in Commons is to prefix the subject line of messages with the component's name, for example: -
      -
    • [logging] Problem with the ...
    • -

    +
      +
    • [logging] Problem with the ...
    • +

    Questions related to the usage of Apache Commons Logging should be posted to the User List. diff --git a/src/site/xdoc/proposal.xml b/src/site/xdoc/proposal.xml index 555bc71..26e4ad5 100644 --- a/src/site/xdoc/proposal.xml +++ b/src/site/xdoc/proposal.xml @@ -17,7 +17,9 @@ --> - + Proposal for Logging Library Package @@ -51,21 +53,21 @@ implementations.

    The package should : +

    • Have an API which should be as simple to use as possible
    • Provide support for Log4j
    • Provide pluggable support for other logging APIs
    -

    Non-goals: +

    • This package will not perform logging itself, except at the most basic level.
    • We do not seek to become a "standard" API.
    -

    diff --git a/src/site/xdoc/tech.xml b/src/site/xdoc/tech.xml index bf30a48..9667248 100644 --- a/src/site/xdoc/tech.xml +++ b/src/site/xdoc/tech.xml @@ -17,8 +17,9 @@ See the License for the specific language governing permissions and limitations under the License. --> - - + Technology Guide Commons Documentation Team diff --git a/src/site/xdoc/troubleshooting.xml b/src/site/xdoc/troubleshooting.xml index a97faf7..e0c6cab 100644 --- a/src/site/xdoc/troubleshooting.xml +++ b/src/site/xdoc/troubleshooting.xml @@ -19,8 +19,9 @@ --> - - + Troubleshooting Guide Commons Documentation Team @@ -37,7 +38,6 @@
    • When To Use Diagnostic Logging -
      • How To Use Diagnostic logging @@ -86,15 +86,12 @@
        • Apache Tomcat -
          • JBoss Application Server -
            • Other Containers -
            • @@ -134,19 +131,19 @@ Diagnostics uses the concept of an Object ID (OID). This allows the identity of to be tracked without relying on useful toString implementations. These are of the form:

              -
              +
               classname@system identity hash code
              -
              +

              The system identity hash code is found by calling System.identityHashCode() which should uniquely identify a particular instance. The classname is usually the fully qualified class name though in a few cases, org.apache.commons.logging.impl.LogFactoryImpl may be shortened to LogFactoryImpl to increase ease of reading. For example:

              -
              +
               sun.misc.Launcher$AppClassLoader@20120943
               LogFactoryImpl@1671711
              -
              +

              OIDs are intended to be used to cross-reference. They allow particular instances of classloaders and JCL classes to be tracked in different contexts. This plays a vital role in building @@ -158,9 +155,9 @@ up the understanding of the classloader environment required to diagnose JCL pro Each diagnostic message is prefixed with details of the relevant class in a standard format. This takes the form:

              -
              +
               [class-identifier from ClassLoader OID]
              -
              +

              ClassLoader OID is the OID of a classloader which loaded the class issuing the message. @@ -170,19 +167,19 @@ the class issuing the message. In the case of LogFactory, this is just LogFactory. For example (line split):

              -
              +
               [LogFactory 
                  from sun.misc.Launcher$AppClassLoader@20120943] BOOTSTRAP COMPLETED
              -
              +

              In the case of LogFactoryImpl, the prefix is the instance OID. This can be cross referenced to discover the details of the TCCL used to manage this instance. For example (line split):

              -
              +
               [LogFactoryImpl@1671711 
                  from sun.misc.Launcher$AppClassLoader@20120943] Instance created.
              -
              +

              @@ -193,12 +190,12 @@ Each classloader is represented (visually) by an OID (to allow cross referencing and the relationship indicated in child --> parent fashion. For example (line split for easy reading):

              -
              +
               ClassLoader tree:java.net.URLClassLoader@3526198  
                     --> sun.misc.Launcher$AppClassLoader@20120943 (SYSTEM) 
                     --> sun.misc.Launcher$ExtClassLoader@11126876 
                     --> BOOT
              -
              +

              Represents a hierarchy with four elements ending in the boot classloader.

              @@ -216,15 +213,15 @@ are logged.

              Many Sun classloaders have confusing toString values. For example, the OID may be

              -
              +
               sun.misc.Launcher$AppClassLoader@20120943
              -
              +

              with a toString value of

              -
              +
               sun.misc.Launcher$AppClassLoader@133056f
              -
              +

              Other classloader implementations may give very useful information (such as the local classpath).

              @@ -252,7 +249,7 @@ allowing the OID later to be cross-referenced to the t and the classloader tree. For example, the following log snippet details the TCCL (lines split):

              -
              +
               [LogFactory from sun.misc.Launcher$AppClassLoader@20120943] 
                   [LOOKUP] LogFactory implementation requested for the first time for context 
                       classloader java.net.URLClassLoader@3526198
              @@ -263,7 +260,7 @@ following log snippet details the TCCL (lines split):
                       --> sun.misc.Launcher$AppClassLoader@20120943 (SYSTEM)  
                         --> sun.misc.Launcher$ExtClassLoader@11126876 
                           --> BOOT
              -
              +

              @@ -305,11 +302,11 @@ The Apache Commons team would be grateful if reports were posted to the developm of other containers using a custom implementation.

              - +

              Symptoms

              An exception is thrown by JCL with a message similar to:

              -
              +  
                 The chosen LogFactory implementation does not extend LogFactory. Please check your configuration. 
                 (Caused by java.lang.ClassCastException: The application has specified that a custom LogFactory 
                 implementation should be used but Class 'com.ibm.ws.commons.logging.TrLogFactory' cannot be converted 
              @@ -319,14 +316,13 @@ of other containers using a custom implementation.
                 LogFactory then it is likely that the container has set one without your knowledge. 
                 In this case, consider using the commons-logging-adapters.jar file or specifying the standard 
                 LogFactory from the command line. Help can be found @https//commons.apache.org/logging.
              -  
              +

              This is a WebSphere example so the name of the custom LogFactory is com.ibm.ws.commons.logging.TrLogFactory. For other containers, this class name will differ.

              -
              - +

              Explanation

              A custom LogFactory implementation can only be used if the implementation class loaded dynamically at runtime can be cast to the LogFactory class that loaded it. There are @@ -357,8 +353,7 @@ containers which have custom implementations: the above runtime exception may be under certain classloading policies without the user knowingly specifying a custom implementation.

              -
              - +

              Fixes

              There are various ways to fix this problem. Which fix is right depends on the circumstances.

              @@ -371,9 +366,9 @@ implementation. If you want to bypass the container adaption mechanism then set the appropriate system property to the default value when the container is started:

              -
              + 
                -Dorg.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
              - 
              +

              If you want to continue to use the default container mechanism then:

              @@ -392,7 +387,6 @@ implementation. If you encounter difficulties when applying the fixes recommended, please turn on diagnostics and consult the logs.

              -
    diff --git a/src/test/java/org/apache/commons/logging/impl/WeakHashtableTestCase.java b/src/test/java/org/apache/commons/logging/impl/WeakHashtableTestCase.java index ea6ad98..1a43cf9 100644 --- a/src/test/java/org/apache/commons/logging/impl/WeakHashtableTestCase.java +++ b/src/test/java/org/apache/commons/logging/impl/WeakHashtableTestCase.java @@ -30,9 +30,9 @@ import junit.framework.TestCase; public class WeakHashtableTestCase extends TestCase { - public static class StupidThread extends Thread { + public static class TestThread extends Thread { - public StupidThread(final String name) { + public TestThread(final String name) { super(name); } @@ -183,7 +183,7 @@ public class WeakHashtableTestCase extends TestCase { for (int j=1; j <= OUTER_LOOP; j++) { hashtable = new WeakHashtable(); for (int i = 0; i < t.length; i++) { - t[i] = new StupidThread("Thread:" + i); + t[i] = new TestThread("Thread:" + i); t[i].setDaemon(true); // Otherwise we cannot exit t[i].start(); } diff --git a/src/test/java/org/apache/commons/logging/log4j/StandardTests.java b/src/test/java/org/apache/commons/logging/log4j/StandardTests.java index b9f66be..3f95059 100644 --- a/src/test/java/org/apache/commons/logging/log4j/StandardTests.java +++ b/src/test/java/org/apache/commons/logging/log4j/StandardTests.java @@ -59,7 +59,6 @@ public abstract class StandardTests extends TestCase { * * * @param logEvents is the list of log events received. - * * @param thrown False if logPlainMessages was called * (ie the TestAppender is expected to have received * logevents with no associated exception info). True if