Home

Traffic Server Software Developers Kit

INKTextLogObjectRollingEnabledSet

Enables/disables rolling for a log object..

Prototype

INKReturnCode INKTextLogObjectRollingEnabledSet ( INKTextLogObject the_object, int *rolling_enabled)

Arguments

INKTextLogObject the_object is the log object for which you want to enable/disable rolling.

To enable rolling, set int rolling_enabled to 1; to disable rolling, set to 0.

Description

This API must be used once the object is created (using INKTextLogObjectCreate) and before writing into logs (using INKTextLogObjectWrite). If INKTextLogObjectRollingEnabledSet is not called, then the default value (specified in records.config by the parameter proxy.config.log2.rolling_enabled ) is used.

The rolling interval and offset can be specified via the APIs INKTextLogObjectRollingIntervalSecSet and INKTextLogObjectRollingOffsetHrSet.

Example

If rolling is enabled, then the rolling interval is set to 21600 sec (6 hours) and the offset hour set to 0 (midnight). Thus, the logs will be rolled at 0:00am (midnight), 06:00am, 12:00pm, and 18:00pm each day.

[Note] Note

If the maximum amount of disk space reserved for logs is exhausted and if parameter proxy.config.log2.auto_delete_rolled_files is enabled in records.config, then Traffic Server automatically deletes rolled files to free up disk space.

Returns

INK_SUCCESS if the API is called successfully.

INK_ERROR if an error occurs while calling the API or if an argument is invalid.