spring-cloud / spring-cloud/spring-cloud-commons

Startup info not logged when bootstrap is being used

Open
#1,132 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting-for-triage
Dominant language
Java
Stars
751
Forks
744
Avg merge
1d 14h
Merged PRs (30d)
9

Description

The startup info messages should appear regardless of the existence of a bootstrap being utilitzed.

This code in SpringApplication#prepareContext inhibits the logStartupInfo(boolean).

        if (this.logStartupInfo) {
            this.logStartupInfo(context.getParent() == null);
            this.logStartupProfileInfo(context);
        }

context.getParent() is the bootstrap context when this dependency is included. It is null otherwise.

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-kubernetes-fabric8-config</artifactId>
        </dependency>

I am using

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.6.8</version>
        <relativePath/>
    </parent>

with these related versions

        <spring-cloud-gcp.version>3.2.1</spring-cloud-gcp.version>
        <spring-cloud.version>2021.0.0</spring-cloud.version>

spring-cloud-starter-kubernetes-fabric8-config ends up being version 2.1.0

Example, minimal project.
StartupInfoNotShowing.zip

Apparently, it is due to this code

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with SpringApplication#prepareContext and the referenced BootstrapApplicationListener code in spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/BootstrapApplicationListener.java. Reproduce the behavior with the provided StartupInfoNotShowing.zip minimal project and verify that startup info messages appear both with and without the bootstrap dependency.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.