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 > line within all
<appender name="ROLL" class="jetbrains.buildServer.util.TCRollingFileAppender"> appenders
> 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.
Related internal properties: Do not add teamcity.build.triggeredBy properties to the newly started build (server restart is required) (since 2017.2.4): teamcity.build.parameters.triggeredBy.enabled=false https://youtrack.jetbrains.com/issue/TW-54969 Delete diagnostics thread dumps and traces after the number of days (since 2017.2.4): teamcity.diagnostics.threadDumpsCleaner.maxDaysToKeep=30 teamcity.diagnostics.threadStatCleaner.maxDaysToKeep=30 https://youtrack.jetbrains.com/issue/TW-54874
logs\catalina.outfile if not rotated automatically at all. It is recommended to establish an automatic procedure to rotate the file regularly.