Skip to content

Conversation

@youngledo
Copy link
Contributor

@youngledo youngledo commented Dec 12, 2025

Currently, the startup time of Spring Boot applications is displayed in seconds, but this is not human-friendly for applications with exceptionally long startup times.

image

Times under 60 seconds continue to use decimal seconds (e.g., "3.456 seconds"), while longer durations are displayed in minutes and seconds (e.g., "1 minute 30 seconds") or hours and minutes (e.g., "1 hour 15 minutes"). This makes startup logs more accessible for applications with longer initialization times.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 12, 2025
@youngledo youngledo force-pushed the feature/startup-info-logger branch from 8df1f91 to ff5546a Compare December 12, 2025 14:10
@snicoll
Copy link
Member

snicoll commented Dec 12, 2025

Thanks for the PR. I am not sure we should do this, I suspect that some automated process out there is parsing the value. I'll flag for team attention to collect more feedback from the team.

@snicoll snicoll added the for: team-attention An issue we'd like other members of the team to review label Dec 12, 2025
@youngledo youngledo force-pushed the feature/startup-info-logger branch 3 times, most recently from cd77cfc to 2174833 Compare December 12, 2025 14:51
@youngledo
Copy link
Contributor Author

Thanks for the PR. I am not sure we should do this, I suspect that some automated process out there is parsing the value. I'll flag for team attention to collect more feedback from the team.

Thanks for the feedback! I completely understand the concern about backward compatibility with existing log parsing tools.

I've updated the PR to address this by introducing a configuration option instead of changing the default behavior:

New approach:

  • Added a new property spring.main.log-startup-time-format with two values:
    • decimal (default): Keeps the existing format (e.g., "3.456 seconds")
    • human-readable: Uses the new format (e.g., "1 minute 30 seconds")

Key benefits:

  • Zero breaking changes: Defaults to the existing decimal format, so all existing log parsers and automation tools continue to work
  • Opt-in: Users who prefer human-readable formats can explicitly enable it via configuration
  • Backward compatible: The change is purely additive

This way, users who have long-running applications can opt into more readable startup logs without affecting anyone else. The configuration follows the same naming convention as "spring.main.log-startup-info".

Introduce a new configuration property 'spring.main.log-startup-time-format'
to control how application startup times are displayed in logs. This addresses
concerns about backward compatibility with existing log parsing tools.

The property supports two formats:
- 'decimal' (default): Displays time in seconds with millisecond precision
  (e.g., "3.456 seconds"). This maintains backward compatibility.
- 'human-readable': Displays time in a more intuitive way using appropriate
  units (e.g., "1 minute 30 seconds" or "1 hour 15 minutes").

By defaulting to the existing decimal format, this change ensures no breaking
changes for existing deployments while providing an opt-in mechanism for users
who prefer more readable startup time logs.

Signed-off-by: Huang Xiao <youngledo@qq.com>
@youngledo youngledo force-pushed the feature/startup-info-logger branch from 2174833 to 2f6030b Compare December 12, 2025 14:58
@snicoll
Copy link
Member

snicoll commented Dec 12, 2025

@youngledo please stop. There's no need to change anything until we've had a chance to discuss the merit of the proposal.

@youngledo
Copy link
Contributor Author

Okay, I won't make any changes for now.

@philwebb
Copy link
Member

I often use those number when comparing startup times so I prefer the consistency that the simple seconds figure gives. My vote is to leave things as they are. I also personally don't think the complexity of an additional property is worth the benefit.

@vpavic
Copy link
Contributor

vpavic commented Dec 12, 2025

Perhaps ISO 8601 duration format could be considered here? That should be easier to grasp than the current format (PT14M48.643S vs 888.643 seconds), is more parser friendly, and obviously standards based.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants