Implement option to turn off log rotation via "Application Properties"
See original GitHub issueHi 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:
- Created a year ago
- Comments:9 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

As a workaround, you can also set the value to some arbitrary high number:
@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.xmlif 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.