[logback-user] size based rollback unexpected behaviour

Hakan Küçük hakanskucuk at gmail.com
Thu Jul 20 12:41:01 CEST 2023

I have a basic spring boot application with the logback.xml below


  <appender name="ROLLING"

      <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-4relative [%thread]
%-5level %logger{35} - %msg%n</pattern>

  <root level="DEBUG">
    <appender-ref ref="ROLLING"/>

I created logs with the following code to test the rolling.

public class LogbackApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(LogbackApplication.class, args);

    public void run(String... args) throws Exception {
        for (int i = 0; i < 100000; i++) {
            log.debug("This is DEBUG");
            log.info("This is INFO");
            log.warn("This is WARN");

I observed a log file of more than 25 MB. It is not rolling. If I put some
sleep statements inside logging, it rolls.

Is it a bug? or am I misconfiguring it? or expected behavior because of
performance reasons?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20230720/75b152ce/attachment-0001.htm>

More information about the logback-user mailing list