Hi Piotr,

One more thing I've seen. Finally, I'm modifying directly in the log4j2.xml 
file the buffer size of one of my loggers. I have enabled the debug, the log4j2 
xml file has a monitor interval of 30 seconds.

I start my application with a buffer of 8K. Then:

1. I programmatically change it to 16K while the app is running:
        INFO: 2025-01-28T17:56:17.015816443Z main TRACE Configured node 
RollingRandomAccessFile Key[type: int; name: bufferSize; qualifierType: 
PluginBuilderAttribute]=16384
        
        I check the log4j2.xml file:
         <RollingRandomAccessFile name="ACCESS_LOG" 
fileName="${sys:log.dir}vproxy_access" 
filePattern="${sys:log.dir}vproxy_access.%d{yyyy-MM-dd}" append="true" 
bufferedIo="true" bufferSize="16384" immediateFlush="false">
         
         
2. Then I change it to 2K:
        INFO: 2025-01-28T17:57:47.216638176Z 
Log4j2-TF-1-ConfigurationFileWatcher-6 TRACE Configured node 
RollingRandomAccessFile Key[type: int; name: bufferSize; qualifierType: 
PluginBuilderAttribute]=2048
        
        Check:
        <RollingRandomAccessFile name="ACCESS_LOG" 
fileName="${sys:log.dir}vproxy_access" 
filePattern="${sys:log.dir}vproxy_access.%d{yyyy-MM-dd}" append="true" 
bufferedIo="true" bufferSize="2048" immediateFlush="false">
                        
                        
The point is that, while I'm logging, the ratio of lines that are logged is 
always the same, with 2048 it should be continually logging and with 16384 I 
should see pauses between two consecutive loggings. But not.

Then, if I restart the application, it works as expected.

So, is it possible that changing the buffer size for this 
'RollingRandomAccessFile' is not working on runtime?

Thanks,

Joan.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

Reply via email to