question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement option to turn off log rotation via "Application Properties"

See original GitHub issue

Hi Community!

I’m a novice when it comes to Spring Boot, currently trying out some Spring Cloud Data Flow workflows and i noticed that there doesn’t seem to be an option to turn off log rotation for logs that the application produces. I’m mainly using Docker images and after a few days i always have unnecessarily lots of log files, instead of just one that i can look into. Having an option like logging.logback.rollingpolicy.disable would be so useful for me. Do you think you can implement this feature? Thank you!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mhalbrittercommented, Oct 17, 2022

As a workaround, you can also set the value to some arbitrary high number:

logging.logback.rollingpolicy.max-file-size=10TB
0reactions
Hanmaccommented, Dec 5, 2022

@mhalbritter some solution that shouldn’t break other code: make both this classes there changeable by variables <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> and <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> in https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/logback/file-appender.xml

if no one is changing the variables, it should still work for them. and others can use the properties to change the Appender or the Policy without the need to overwrite the xml files.

Read more comments on GitHub >

github_iconTop Results From Across the Web

26. Logging - Spring
You can force Spring Boot to use a particular logging system by using the org.springframework.boot.logging.LoggingSystem system property. The value should be ...
Read more >
Springboot how to rotate log files on the server restart
I would suggest to use Slf4j along with logback. You need to configure logback.xml and you can configure rolling file appender. Share.
Read more >
Configuring Logback with Spring Boot - CodinGame
This will make use of spring-boot-starter-logging which in turn has dependencies on ... This configuration can be achieved through application.properties as ...
Read more >
Configuring Logging - Quarkus
You can use the JBoss Logging facade inside your code as it's already provided, ... Disable JSON logging in application.properties for dev and...
Read more >
How to use Logback in Spring Boot – Rolling Files Example
Spring Boot allows programmers to easily configure common logging options via the application.properties file. For details about configuring ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found