6 Commits
Author SHA1 Message Date
Piotr P. Karwasz 3ed2daf47f [LOGGING-192] Fix factory loading from TCCL (#281)
This fixes the loading of standard `LogFactory` implementations from the TCCL.

The current code has a fallback clause in `newFactory`, so it can happen that the code tests for the presence of Log4j API and SLF4J in the TCCL, but it actually loads the factory from the current classloader (which lacks either of those libraries).
2024-08-14 18:56:20 -04:00
Piotr P. Karwaszanddependabot[bot] 71f4304533 Upgrade log4j-api to version 2.23.1 (#230)
* Bump log4j2.version from 2.22.1 to 2.23.1

Bumps `log4j2.version` from 2.22.1 to 2.23.1.

Updates `org.apache.logging.log4j:log4j-api` from 2.22.1 to 2.23.1

Updates `org.apache.logging.log4j:log4j-core` from 2.22.1 to 2.23.1

Updates `org.apache.logging.log4j:log4j-core-test` from 2.22.1 to 2.23.1

---
updated-dependencies:
- dependency-name: org.apache.logging.log4j:log4j-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.logging.log4j:log4j-core
  dependency-type: direct:development
  update-type: version-update:semver-minor
- dependency-name: org.apache.logging.log4j:log4j-core-test
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Ban `spring-jcl` from the dependencies

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-15 15:03:15 -04:00
Piotr P. Karwasz 80b2f78eb9 Set java.logging as optional module (#183)
Commons Logging has a fallback simple logger that is used if the
`java.util.logging` package is not present.

Originally this only could happen with Java 1.3, but sinc Java 9 the
user can disable the `java.logging` JPMS module. Commons Logging will
work anyway.

This PR slightly modifies the inherited Moditect configuration to add a
`static` (i.e. optional) modifier to the `java.logging` module.
2023-11-25 15:29:00 -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
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
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