Skip to content

The active profiles log message is ambiguous when a profile's name contains a comma #29739

@gcoppex

Description

@gcoppex

Syntax improvement in the log output:

The standard logging output reports the active profile(s) used but the sentence is always in plural form (The following profiles are active):

... 2022-01-10 17:07:48.046 INFO 14436 --- [ restartedMain] com.mycompany.myapp.TestApp : The following profiles are active: profile0 ... 

This is misleading when one profile is active but dangerous when more profiles are badly activated (read below).

Bad profile activation:

The comma is used as a separator in the environment variable parsing - i.e. running the application with:

-Dspring.profiles.active=profile0,profile1 

However it is tempting to simply copy-paste profile0,profile1 in the active profile annotation and write:

@ActiveProfiles("profile0,profile1") 

This (wrong) profile activation would make spring-boot activate a single profile (whose name contains a comma).
The log output would still be expressed in plural form, misleading the developer to think two profiles are active.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: supersededAn issue that has been superseded by anothertype: bugA general bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions