<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'>Using logback 1.2.3 in Spring Boot 2.3.2. What I’m seeing is that upon startup, the file is created with size 0 and doesn’t flush. The default buffer size is 8k, no? Shouldn’t it flush every 8k? If I close my app, then the logfile is written (about 17k). Logback-spring.xml is below. This is on Windows 10 x64.<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'><?</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>xml</span><span style='font-size:10.0pt;font-family:Consolas'> <span style='color:#7F007F'>version</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"1.0"</span></i> <span style='color:#7F007F'>encoding</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"UTF-8"</span></i><span style='color:teal'>?></span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'><!</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>DOCTYPE</span><span style='font-size:10.0pt;font-family:Consolas'> <span style='color:teal'>configuration></span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>configuration</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><span style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:black'>       </span><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>include</span><span style='font-size:10.0pt;font-family:Consolas'> <span style='color:#7F007F'>resource</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"org/springframework/boot/logging/logback/base.xml"</span></i> <span style='color:teal'>/></span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:black'>       </span><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F;background:#D4D4D4'>appender</span><span style='font-size:10.0pt;font-family:Consolas'> <span style='color:#7F007F'>name</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"FILE"</span></i> <span style='color:#7F007F'>class</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"ch.qos.logback.core.rolling.RollingFileAppender"</span></i><span style='color:teal'>></span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:black'>              </span><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>file</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><span style='font-size:10.0pt;font-family:Consolas;color:black'>${LOG_PATH}/${LOG_FILE}.log</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'></</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>file</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><span style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:black'>              </span><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>rollingPolicy</span><span style='font-size:10.0pt;font-family:Consolas'> <span style='color:#7F007F'>class</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"</span></i><span style='color:teal'>></span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:black'>                     </span><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>fileNamePattern</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><span style='font-size:10.0pt;font-family:Consolas;color:black'>${LOG_PATH}/${LOG_FILE}.%d{yyyy-MM-dd}.log</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'></</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>fileNamePattern</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><span style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:black'>                     </span><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>maxHistory</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><span style='font-size:10.0pt;font-family:Consolas;color:black'>7</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'></</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>maxHistory</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><span style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:black'>              </span><span style='font-size:10.0pt;font-family:Consolas;color:teal'></</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>rollingPolicy</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><span style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:black'>              </span><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>encoder</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><span style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:black'>                     </span><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>pattern</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><span style='font-size:10.0pt;font-family:Consolas;color:black'>${FILE_LOG_PATTERN}</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'></</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>pattern</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><span style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:black'>              </span><span style='font-size:10.0pt;font-family:Consolas;color:teal'></</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>encoder</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><span style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:black'>       </span><span style='font-size:10.0pt;font-family:Consolas;color:teal'></</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F;background:#D4D4D4'>appender</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><span style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:black'>       </span><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>root</span><span style='font-size:10.0pt;font-family:Consolas'> <span style='color:#7F007F'>level</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"INFO"</span></i><span style='color:teal'>></span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:black'>              </span><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>appender-ref</span><span style='font-size:10.0pt;font-family:Consolas'> <span style='color:#7F007F'>ref</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"CONSOLE"</span></i> <span style='color:teal'>/></span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:black'>              </span><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>appender-ref</span><span style='font-size:10.0pt;font-family:Consolas'> <span style='color:#7F007F'>ref</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"FILE"</span></i> <span style='color:teal'>/></span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:black'>       </span><span style='font-size:10.0pt;font-family:Consolas;color:teal'></</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>root</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><span style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Consolas;color:teal'></</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>configuration</span><span style='font-size:10.0pt;font-family:Consolas;color:teal'>></span><span style='font-size:10.0pt;font-family:Consolas'><o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>