Symptoms
- Following the documentation on the TeamCity logging and log4j documentation, the logging configuration was changed to create, for example, a new
teamcity-activities.logfile every day. - However, the new files are not created on a date change.
Cause
There is a known issue related to time-based rolling of log files: Time-based logs rolling is not working for TC logs.
Resolution
As a workaround, it is possible to:
- Delete the enclosing
<DelegateAppender>...</DelegateAppender>in the configuration file. - The following configuration will create a new file every day:
<RollingFile name="ACTIVITIES.LOG"
filePattern="${sys:teamcity_logs}/teamcity-activities.%d{yyyy-MM-dd}.log"
append="true" createOnDemand="true">
<PatternLayout pattern="[%d] %6p - %30.30c - %m%n" charset="UTF-8"/>
<Policies><TimeBasedTriggeringPolicy interval="1" modulate="true" /></Policies>
<DirectWriteRolloverStrategy/>
</RollingFile>
The downside of this workaround is that it will render TeamCity features, such as replacing passwords with asterisks in log files on the agent side and health reports about found errors in logs on the server side, ineffective.
Comments
0 comments
Please sign in to leave a comment.