If you want to ensure that you do not store the internal TeamCity logs for more than a limited amount of days, you can configure internal logging to rotate the log files each day and limit the number of files to keep. TeamCity agents generally do not operate with any user-related data in a structural way, but if you need to ensure the logs are regularly rotated on the agent, you will need to configure agent logging the same way.
Per-day rotation can be configured by adding
<param name="rotateOnDayChange" value="true"/> line within all
<appender name="ROLL" class="jetbrains.buildServer.util.TCRollingFileAppender"> appenders
. This change should be done to the default conf\teamcity-server-log4j.xml and also logging presets stored under <TeamCity Data Directory>\config\_logging.
logs\catalina.outfile if not rotated automatically at all. It is recommended to establish an automatic procedure to rotate the file regularly.