# Kafka-connect log file limitataion help

**URL:** <https://forum.confluent.io/t/kafka-connect-log-file-limitataion-help/9981>\
**Category:** Kafka Connect\
**Created:** [31 January 2024 07:54 UTC](https://forum.confluent.io/t/kafka-connect-log-file-limitataion-help/9981 "2024-01-31T07:54:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![partha06](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/partha06/32/3555_2.png) [@partha06](https://forum.confluent.io/u/partha06)\
**Post date:** [31 January 2024 07:54 UTC](https://forum.confluent.io/t/kafka-connect-log-file-limitataion-help/9981/1 "2024-01-31T07:54:48Z")

</div>

kafka-connect log files eating our server full disk space any help how we can limit the size of it ?  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![dtroiano](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/dtroiano/32/1961_2.png) [@dtroiano](https://forum.confluent.io/u/dtroiano)\
**Post date:** [31 January 2024 15:27 UTC](https://forum.confluent.io/t/kafka-connect-log-file-limitataion-help/9981/2 "2024-01-31T15:27:02Z")

</div>

A quick fix for this is to use log4j’s `RollingFileAppender` instead of the `DailyRollingFileAppender` which is likely the default that you are getting. `RollingFileAppender` only keeps a configured number of files around while `DailyRollingFileAppender` accumulates log files.

The log4j configuration file is specified to the worker by the `log4j.configuration` property, e.g., you should see the worker run command containing a property like `-Dlog4j.configuration=file:/etc/kafka/connect-log4j.properties`. That properties file is where you can change the root logger’s appender. [Here](https://github.com/confluentinc/ksql/blob/37971037e35c13b7a07cd8d613b7f457d9c5031b/config/log4j-rolling.properties#L22-L28) is a `RollingFileAppender` example from the ksqlDB codebase.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/confluentcommunity/original/1X/c49438c90c9df282e9996fdf6971be890c71b65a.svg) [@system](https://forum.confluent.io/u/system)\
**Post date:** [1 March 2024 15:27 UTC](https://forum.confluent.io/t/kafka-connect-log-file-limitataion-help/9981/3 "2024-03-01T15:27:15Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
