Search code examples
google-cloud-platformapache-flinkflink-streaming

Logrotation for flink not working with logrotate.d


I would like to enable log rotation for flink but didn't see an option to reload the process.

Tried to enable log rotation using "logrotate.d" with copytruncate option but leading to the creation of sparse files.

Is there any option to enable log rotation for flink taskmanager without restarting the process.


Solution

  • Have you tried something like inside log4j.properties in flink/conf installation? log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.File=${log.file} log4j.appender.file.MaxFileSize=1000MB log4j.appender.file.MaxBackupIndex=0 log4j.appender.file.append=false log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %-60c %x - %m%n