Comments (5)
At the very least please let me know how I can disable this as we do not feel it is worth having in our production deployments.
from spring-boot.
Boot only enables packaging data when loading its defaults. If you're using a custom logback.xml
or logback-spring.xml
it shouldn't be enabled. For example, this logback-spring.xml
does not produce any packaging data:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />
<root level="INFO">
<appender-ref ref="CONSOLE" />
</root>
</configuration>
This was tested with Spring Boot 3.2.3. Can you please provide a minimal example that shows the packaging data being logged when it should not have been?
from spring-boot.
This is what the beginning of our current logback-spring.xml looks like.. it is in the classpath and I dont see any other specially named config xmls in the classpath.
<?xml version="1.0" encoding="UTF-8"?> <configuration debug="true" packagingData="false"> <springProfile name="dev"> <appender name="Console" class="ch.qos.logback.core.ConsoleAppender"> <encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder"> <providers> <timestamp> <fieldName>@timestamp</fieldName> </timestamp> <globalCustomFields>
Here is a sample stacktrace showing up in our logs:
java.lang.NullPointerException: Cannot invoke "String.startsWith(String)" because "hostname" is null at com.mobilitywarertb.client.http.impl.PooledHttpClient.makeCall(PooledHttpClient.java:237) ~[classes!/:na] at com.mobilitywarertb.client.http.impl.PooledHttpClient.httpGetRequest(PooledHttpClient.java:79) ~[classes!/:na] at com.mobilitywarertb.client.hystrix.HystrixHttpClient.run(HystrixHttpClient.java:152) ~[classes!/:na] at com.mobilitywarertb.client.hystrix.HystrixHttpClient.run(HystrixHttpClient.java:30) ~[classes!/:na] at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:302) ~[hystrix-core-1.5.18.jar!/:1.5.18] at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:298) ~[hystrix-core-1.5.18.jar!/:1.5.18] at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:46) ~[rxjava-1.2.0.jar!/:1.2.0] at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35) ~[rxjava-1.2.0.jar!/:1.2.0] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[rxjava-1.2.0.jar!/:1.2.0] at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) ~[rxjava-1.2.0.jar!/:1.2.0]
Edit: we are on spring boot 2.7.14
from spring-boot.
We do use the spring profiles... and those are set via:
spring.profiles.active=${ENVIRONMENT_NAME}
In application.properties.
from spring-boot.
OSS support Spring Boot 2.7.x is no longer available. That said, I can't reproduce the problem with 2.7.x either. Here's an app using the logback-spring.xml
that I shared above:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.7.18)
2024-03-08 08:35:40.032 INFO 92917 --- [ main] com.example.gh39817.Gh39817Application : Starting Gh39817Application using Java 17.0.1 on wilkinsonaGMD6R.vmware.com with PID 92917 (/Users/awilkinson/Downloads/gh-39817/bin/main started by awilkinson in /Users/awilkinson/Downloads/gh-39817)
2024-03-08 08:35:40.034 INFO 92917 --- [ main] com.example.gh39817.Gh39817Application : No active profile set, falling back to 1 default profile: "default"
2024-03-08 08:35:40.404 INFO 92917 --- [ main] com.example.gh39817.Gh39817Application : Started Gh39817Application in 0.711 seconds (JVM running for 0.965)
2024-03-08 08:35:40.423 ERROR 92917 --- [ main] o.s.boot.SpringApplication : Application run failed
java.lang.NullPointerException: null
at com.example.gh39817.Gh39817Application.onStartup(Gh39817Application.java:31)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:344)
at org.springframework.context.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:229)
at org.springframework.context.event.ApplicationListenerMethodAdapter.onApplicationEvent(ApplicationListenerMethodAdapter.java:166)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:178)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:171)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:429)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:386)
at org.springframework.boot.context.event.EventPublishingRunListener.ready(EventPublishingRunListener.java:114)
at org.springframework.boot.SpringApplicationRunListeners.lambda$ready$6(SpringApplicationRunListeners.java:82)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114)
at org.springframework.boot.SpringApplicationRunListeners.ready(SpringApplicationRunListeners.java:82)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:323)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1289)
at com.example.gh39817.Gh39817Application.main(Gh39817Application.java:26)
I also cannot reproduce it with debug="true"
in the Logback configuration. I suspect there must be something else in your app that's enabling packaging data that's out of Spring Boot's control. In the absence of any evidence that Spring Boot is forcing packaging data to be enabled when using custom Logback configuration, I'm going to close this issue. If you can share a complete reproducer, not just a partial snippet of config, with Spring Boot 3.1.x or later we can re-open it and take another look.
from spring-boot.
Related Issues (20)
- Clarify that all named properties must match for @ConditionalOnProperty to match HOT 2
- Getting 500 instead of 404 with integration tests when updating from Spring Boot 3.1.x to to 3.2.4 HOT 6
- Bump gradle/wrapper-validation-action from 2.1.1 to 2.1.2
- Bump gradle/wrapper-validation-action from 2.1.1 to 2.1.2
- Remove redundant Regex escapes
- Remove redundant Regex escapes
- Remove redundant Regex escapes
- Verify snapshots once they have been deployed
- Verify snapshots once they have been deployed
- Verify snapshots once they have been deployed
- Upgrade to Gradle Enterprise Conventions 0.0.16
- Reference Guides breadcrumb in page headers is not hyperlinked HOT 1
- Make it harder to misconfigure logging.threshold.console in yaml HOT 3
- Executable JAR application startup is slower after 3.2.0 when Hibernate scanner is not disabled HOT 6
- bootBuildImage with Podman results in socket connection error HOT 11
- Problem with prometheus metrics and mongodb HOT 4
- Upgrade to Gradle Enterprise Conventions 0.0.16
- Upgrade to Gradle Enterprise Conventions 0.0.16
- Rename Antora component from spring-boot to boot
- Manage antora versions using package.json HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-boot.