[#BloombergLP-ball-FileObserver2-rotateOnTimeInterval-07]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/FileObserver2.adoc[FileObserver2]::rotateOnTimeInterval
:relfileprefix: ../../../
:mrdocs:

Configure periodic log file rotation at the specified `interval`&period;

== Synopsis

Declared in `&lt;ball&lowbar;fileobserver2&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
rotateOnTimeInterval(xref:BloombergLP/bdlt/DatetimeInterval.adoc[bdlt::DatetimeInterval] const& interval);
----

== Description

Set this file observer to perform a periodic log file rotation at multiples of the specified `interval`&period; Optionally specify a `startTime` indicating the datetime to use as the starting point for computing the periodic rotation schedule&period; If `isPublishInLocalTimeEnabled` is `true`, the `startTime` is interpreted as local time, and as a UTC time otherwise&period; If `startTime` is not specified, the current time is used&period; This rule replaces any rotation&hyphen;on&hyphen;time&hyphen;interval rule currently in effect&period; The behavior is undefined unless `0 &lt; interval&period;totalMilliseconds()`&period; Note that `startTime` may be a fixed time in the past&semi; e&period;g&period;, a reference time of `bdlt&colon;&colon;Datetime(1, 1, 1)` and an interval of 24 hours would configure a periodic rotation at midnight each day&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *interval*
| periodic interval between log file rotations
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
