1
0
Commit Graph

255 Commits

Author SHA1 Message Date
Gary Gregory
5c371bcbbd Organize imports 2023-11-25 11:08:11 -05:00
Piotr P. Karwasz
35427e2ce7 Disable Lumberjack and Log4j 1.x and document it (#182)
This PR removes Lumberjack and Log4j 1.x for the automatic logging
backend discovery procedure.

The updated procedure is documented in the guide.

This closes LOGGING-173 and LOGGING-188.
2023-11-25 11:06:46 -05:00
Gary Gregory
e4d94ff51e Spelling 2023-11-20 19:22:47 -05:00
Gary Gregory
6b11d8ab2e Spelling in comments 2023-11-20 09:58:59 -05:00
Gary Gregory
2039eeba6f Fix compiler warnings 2023-11-19 16:33:27 -05:00
Gary Gregory
a06ae06925 Format nits 2023-11-19 16:24:55 -05:00
Gary Gregory
a39a6d1234 Format nits 2023-11-19 16:21:18 -05:00
Gary Gregory
12ae9e6324 Remove obsolete comments
Move static block
2023-11-19 09:51:16 -05:00
Gary Gregory
9b69ba8a04 Adjust test assertions for previous commit 2023-11-19 09:24:05 -05:00
Gary Gregory
2521602a8a Sort members 2023-11-19 09:02:31 -05:00
Gary Gregory
b10322e41e Use Checkstyle sortStaticImportsAlphabetically 2023-11-19 09:01:36 -05:00
Piotr P. Karwasz
6ad06e9074 LOGGING-185: Fix failing tests (#180)
* Fix names of deployed artifacts

We remove the obsolete `finalName` property and fix the Maven Failsafe
executions.

* Fix failing tests

* Reenable integration tests

* Disable SecurityManager tests on Java 21

* Simplify build workflow

* Set `fail-fast` to false

* Fix NPEs caused by `String.trim()`

* Span a different JVM per test case
2023-11-18 19:36:11 -05:00
Gary Gregory
e94276a98b Merge branch 'master' of https://gitbox.apache.org/repos/asf/commons-logging.git 2023-11-05 09:31:49 -05:00
Gary Gregory
dd5be155fe Make package private class final 2023-11-05 09:31:38 -05:00
Piotr P. Karwasz
946711e0a6 Add support for Log4j API and SLF4J (#177)
The logging backends supported by the default `LogFactoryImpl` have all
reached their end-of-life (except JUL and `SimpleLog`). Third-generation
logging backends, such as Log4j Core, support multiple logger contexts
per application and therefore can not be handled by the simplified
caching mechanism in `LogFactoryImpl`.

This PR introduces two new `LogFactory` implementations,
`Log4j2LogFactory` and `Slf4jLogFactory`, that forward messages to the
Log4j API and SLF4J.

During initialization the three existing factories are checked in the
following order:
 1. the `Log4j2LogFactory` has highest priority, since the Log4j API can
    faithfully transmit messages of type `Object`,
 2. the `Slf4jLogFactory` is the next choice. However, if the
    Log4j-to-SLF4J bridge is present we log directly through SLF4J
    instead of the Log4j API.
 3. the legacy `LogFactoryImpl` has lowest priority.
2023-11-03 11:19:14 -04:00
Gary Gregory
b7f50da2aa Normalize setter Javadoc 2023-10-31 07:10:27 -04:00
Gary Gregory
28c175b8c8 Fix spelling 2023-10-31 06:27:13 -04:00
Gary Gregory
6167752d52 Normalize spelling to US English 2023-10-31 06:23:46 -04:00
Gary Gregory
32c8bd6257 Javadoc: Better wording 2023-10-19 10:50:29 -04:00
Gary Gregory
bc3c5461a4 Camel-case parameter and internal names
Spelling
2023-10-19 08:37:35 -04:00
Gary Gregory
245211c4bd Use final
Use compact array notation
Remove trailing whitespace
2023-10-18 17:06:46 -04:00
Gary Gregory
174f40d168 Organize imports 2023-10-18 17:05:12 -04:00
Gary Gregory
0b4d31d127 Sort members 2023-10-18 17:04:00 -04:00
Piotr P. Karwasz
ca2cdfee81 [LOGGING-186] Replace custom code with ServiceLoader call (#171)
* Replace custom code with `ServiceLoader` call

* Files should end with an empty line

* Files should end with an empty line

* Comment empty block

* Comment empty block

---------

Co-authored-by: Gary Gregory <garydgregory@users.noreply.github.com>
2023-10-18 16:47:48 -04:00
Gary Gregory
260d5e2177 Update call deprecated in Java 9 2023-10-02 12:05:29 -04:00
Alex Herbert
acd4893d89 Introduce end-of-line normalization 2023-09-02 13:37:42 +01:00
Gary Gregory
58b1369ac1 Normalize array type declarations 2023-08-23 08:48:30 -04:00
Gary Gregory
eee5bef7f0 Fix formatting 2023-08-22 11:00:58 -04:00
Gary Gregory
869eaa18df Format: "catch(" -> "catch (" 2023-04-18 10:56:16 -04:00
Gary Gregory
cb67ea239e Spelling 2023-01-01 11:13:50 -05:00
Gary Gregory
10377b63fa Fix spelling 2022-10-22 16:32:28 -04:00
Gary Gregory
b83b31411a Spelling 2022-10-22 16:31:05 -04:00
Gary Gregory
5f5affb467 We don't use author tag, CVS/SVN tags or lots of whitespace
Add a space before { when missing
2022-08-30 09:46:14 -04:00
Gary Gregory
e7bac9a257 Normalize Javadoc spelling 2022-06-15 08:20:20 -04:00
Gary Gregory
59bbadfc5a Remove noisy inline comments. 2022-05-31 11:29:02 -04:00
Arturo Bernal
073350edf6 Simplify assert with simpler and equivalent calls. 2022-04-23 01:24:04 +02:00
Gary Gregory
bc4af18850 Delete "@version $Id$" from Subversion days. 2022-03-10 13:39:31 -05:00
Jakob van Kruijssen
e7b328d7e0 Use a weak reference for the cached class loader (#71)
This replaces the strong reference to the class loader, `thisClassLoader`,
with a weak one.

The strong ref shows up as causing a GC root after unloading a web app in Tomcat that uses this library.
With these modifications, the GC root is gone...
2022-01-05 09:35:08 -05:00
Arturo Bernal
ddda30a482 LOGGING-177 - Remove redundant initializer (#46) 2022-01-04 07:54:30 -05:00
Gary Gregory
5660a6f6ec Use Javadoc code tags instead of HTML (except when code blocks use tag
delimiters).
2021-10-17 11:19:18 -04:00
Gary Gregory
d2a0dc8d31 Simplify expressions. 2021-07-10 09:53:06 -04:00
Gary Gregory
1642a1bd98 No need to nest in else. 2021-03-05 14:43:24 -05:00
Gary Gregory
7bd861788d Use varargs. 2021-02-28 17:54:22 -05:00
Gary Gregory
c2afed56ab Raise embedded if into parent if. 2021-02-28 12:43:57 -05:00
Gary Gregory
a3661dd192 Normalize to US English spelling. 2021-02-08 14:14:24 -05:00
Gary Gregory
610117ab32 Normalize to US English spelling. 2021-02-08 14:06:20 -05:00
Arturo Bernal
c9818fa7b2 Minor Improvement: (#34)
* Change 'StringBuffer' by 'StringBuilder'
* Fix javadoc
* Remove redundant initializer
* Use Empty array
2021-01-17 16:47:03 -05:00
Gary Gregory
5964482025 Remove unused import. 2021-01-08 10:27:41 -05:00
Gary Gregory
02ac584cd9 Add missing '@Override' annotations. 2020-11-21 13:56:50 -05:00
Gary Gregory
cd99c4164f Use for-each. Use final. Remove redundant modifiers. 2020-11-21 13:39:02 -05:00