Commit Graph

4166 Commits

Author SHA1 Message Date
Moritz Halbritter
166926881f Read PID and version used in startup logging from the environment
See gh-41604
2024-08-01 16:14:18 +02:00
Moritz Halbritter
f4b4f4f0bf Make PID and application version available in the environment
Adds the following new properties:

- spring.application.pid
- spring.application.version

Refactors the ResourceBanner and the structured logging support to use
the new properties.

Closes gh-41604
2024-08-01 15:03:41 +02:00
Phillip Webb
fb72345491 Polish JsonWriter API 2024-07-30 13:06:48 +01:00
Andy Wilkinson
6278d803a5 Merge branch '3.3.x'
Closes gh-41634
2024-07-29 12:13:07 +01:00
Andy Wilkinson
87417c0536 Merge branch '3.2.x' into 3.3.x
Closes gh-41633
2024-07-29 11:57:09 +01:00
Andy Wilkinson
4ee24bf9bd Polish "Add rule to prevent calls to Objects.requireNonNull()"
See gh-41611
2024-07-29 11:41:26 +01:00
Moritz Halbritter
870b02b4d3 Polish 2024-07-29 11:24:49 +02:00
Andy Wilkinson
e201b94d4f Merge branch '3.3.x'
Closes gh-41616
2024-07-25 16:17:52 +01:00
Andy Wilkinson
c642f6d268 Merge branch '3.2.x' into 3.3.x
Closes gh-41613
2024-07-25 16:16:35 +01:00
Brian Clozel
e2bd95596d Shut down Reactor Schedulers for WAR deployments
Prior to this commit, Spring applications and libraries would call
`Schedulers.boundedElastic()` or similar static methods at runtime. This
would ininitialize and cache reactive schedulers for the Reactor core
library. Those instances are cached for the lifetime of the JVM and are
shared static instances.

In a  WAR deployment case, those schedulers would be initialized and
tied to the web application servlet context class loader. When
undeploying the web applications, schedulers would not be automatically
shut down and this would keep the now useless application classloader,
leaking resources.

This commit ensures that Spring Boot shuts down shared schedulers if
they were loaded and initiazed by the web application classloader, once
the the Spring application context is closed.

Closes gh-41548
2024-07-25 16:06:59 +02:00
Andy Wilkinson
5f666eec5b Reduce warnings reported by Eclipse
Closes gh-41598
2024-07-25 14:55:00 +01:00
Phillip Webb
de3b14f2b4 Refine structured logging
Refine structured logging to support `Environment`, `ApplicationPid` and
`ElasticCommonSchemaService` injection. With these updates we are able
to remove the `ApplicationMetadata` class and simplify the parameters
passed to the layout/encoder classes.

Closes gh-41491
2024-07-24 19:06:07 +01:00
Phillip Webb
50dbaec2d0 Refine JsonWriter for structured logging
Add `formatToBytes()` method for use with structured logging.

See gh-41491
2024-07-24 19:06:07 +01:00
Phillip Webb
700c1e8f82 Refine ApplicationPid for structured logging
Update `ApplicationPid` with `toLong()` and `isAvailable()` methods to
make it easier to use with structured logging.

See gh-41491
2024-07-24 19:06:07 +01:00
Andy Wilkinson
09fdb9d36c Allow child context to override parent's configuration properties
Closes gh-41487
2024-07-24 18:47:19 +01:00
Andy Wilkinson
23b344691d Polish "Support @Name with JavaBean-based configuration properties"
See gh-39452
2024-07-23 14:00:20 +01:00
BenchmarkingBuffalo
a305e2d1bd Support @Name with JavaBean-based configuration properties
See gh-39452
2024-07-23 13:48:19 +01:00
Andy Wilkinson
c790deb7d2 Merge branch '3.3.x'
Closes gh-41590
2024-07-23 10:06:46 +01:00
Andy Wilkinson
72fd3f9392 Merge branch '3.2.x' into 3.3.x
Closes gh-41589
2024-07-23 10:06:15 +01:00
Andy Wilkinson
72867a3b25 Broaden test coverage for property binding with @Name
Closes gh-41588
2024-07-23 09:39:17 +01:00
Phillip Webb
c38adaedc2 Test that ConnectionFactoryUnwrapper works without pooled-jms jar
Closes gh-41583
2024-07-23 08:37:58 +01:00
Phillip Webb
88480664d7 Polish 2024-07-22 19:59:27 +01:00
Phillip Webb
000600c68a Merge branch '3.3.x' 2024-07-22 18:41:53 +01:00
Phillip Webb
36b1214feb Merge branch '3.2.x' into 3.3.x 2024-07-22 18:30:45 +01:00
Phillip Webb
61dc82d836 Update copyright year of changed files 2024-07-22 18:16:19 +01:00
Phillip Webb
ff1a4654d2 Polish 2024-07-22 18:15:57 +01:00
Andy Wilkinson
a12bfd9ec3 Polish "Derive driverClassName from URL when otherwise unknown"
See gh-39376
2024-07-22 09:42:28 +01:00
Ronald Mik
4611230d69 Derive driverClassName from URL when otherwise unknown
See gh-39376
2024-07-22 09:41:58 +01:00
Andy Wilkinson
4d466c3cc0 Merge branch '3.3.x'
Closes gh-41564
2024-07-19 16:29:31 +01:00
Andy Wilkinson
8e82aad6ff Merge branch '3.2.x' into 3.3.x
Closes gh-41563
2024-07-19 16:29:15 +01:00
Andy Wilkinson
a10b000119 Fix constructor binding of EnumMaps
Fixes gh-41550
2024-07-19 16:28:16 +01:00
Stéphane Nicoll
8e93b9f04a Start building against Spring Framework 6.2.0-M6 snapshots
See gh-41555
2024-07-18 12:40:45 +02:00
Stéphane Nicoll
fc2890d1cd Use native connection factory with message listener containers
This commit updates the auto-configuration to use the native connection
factory for configuring message listener containers. Previously, the
connection factory that could have been wrapped in a caching connection
factory was used.

While using a caching connection factory is suitable for sending
messages (i.e. JmsTemplate usage), it isn't for message listeners as
they need to own the connection for local recovery purposes.

Closes gh-39816
2024-07-17 10:41:12 +02:00
lijuny
b6901044c7 Polish
See gh-41510
2024-07-16 07:49:43 +02:00
Phillip Webb
d2cd5c9b98 Fix Arrays import
See gh-41489
2024-07-16 02:23:24 +01:00
Andy Wilkinson
00c2fbc42b Polish 2024-07-15 14:34:36 +01:00
Andy Wilkinson
1ec2a38ea0 Fix structured logging tests on Windows
See gh-5479
2024-07-15 14:32:12 +01:00
Moritz Halbritter
bf2950c045 Add support for structured logging
Update Logback and Log4j2 integrations to support structured logging.
Support for the ECS and Logstash JSON formats is provided out-of-the-box
and the `StructuredLogFormatter` interface may be used to if further
custom formats need to be supported.

Closes gh-5479

Co-authored-by: Phillip Webb <phil.webb@broadcom.com>
2024-07-15 11:45:41 +01:00
Phillip Webb
20c2af13e3 Add JsonWriter utility interface
Add `JsonWriter` utility interface that can be used to write JSON
without the need for a third-party library.

Closes gh-41489

Co-authored-by: Moritz Halbritter <moritz.halbritter@broadcom.com>
2024-07-15 11:45:41 +01:00
Moritz Halbritter
bb8241fa8c Polish 2024-07-15 11:45:40 +01:00
Stéphane Nicoll
4415b4ab1c Polish "Allow NestedConfigurationProperty on getters"
See gh-38844
2024-07-15 10:02:58 +02:00
Jared Bates
6c8987e0d8 Allow NestedConfigurationProperty on getters
This commit adds support adding `@NestedConfigurationProperty` on a
getter.

See gh-38844
2024-07-15 09:24:27 +02:00
Andy Wilkinson
acdaa6dc35 Tolerate multiple identical configurations in Logback AOT contribution
Fixes gh-36997
2024-07-12 11:51:38 +01:00
Phillip Webb
c3ad8b0521 Add APPLICATION_NAME and APPLICATION_GROUP logging properties
Add `APPLICATION_NAME` and `APPLICATION_GROUP` properties that contain
verbatim values rather than formatted strings. Formatting of the values
is now handled by new `EnclosedInSquareBracketsConverter` classes for
both Logback and Log4J2.

The existing `LOGGED_APPLICATION_NAME` variable is now considered
deprecated. The `LOGGED_APPLICATION_GROUP` variable and related
logback converter have been removed since they never made it to a GA
release.

Closes gh-41444
2024-07-11 10:25:01 -07:00
Phillip Webb
db5830a2e0 Polish logging related code 2024-07-11 10:25:01 -07:00
Andy Wilkinson
6f17ff5cb2 Merge branch '3.3.x'
Closes gh-41449
2024-07-11 13:17:12 +01:00
Andy Wilkinson
ecbbe6a9cb Merge branch '3.2.x' into 3.3.x
Closes gh-41448
2024-07-11 13:16:59 +01:00
Andy Wilkinson
8bc45a20d7 Polish "Fix typos in BootstrapContext javadoc"
See gh-41443
2024-07-11 13:16:38 +01:00
John Blum
47fc9111cb Fix typos in BootstrapContext javadoc
See gh-41443
2024-07-11 13:16:10 +01:00
Scott Frederick
09c0714730 Register ProtocolResolvers with the application context by default
Any ProtocolResolvers that are registered in a spring.factories file
will be added to the application context using an
ApplicationContextInitializer.

Closes gh-41433
2024-07-10 15:29:29 -05:00