---
name: "TSTextLogObjectCreate"
section: "3ts"
platform: "linux"
package: "trafficserver-dev"
version: "9.2.5+ds-0+deb12u4"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/TSTextLogObjectCreate"
---

# TSTextLogObjectCreate(3ts)

traffic Server text logging API

## NAME

TSTextLogObjectCreate - traffic Server text logging API

## SYNOPSIS

```
#include <ts/ts.h>
```

- ***TSReturnCode* TSTextLogObjectCreate(const char \*filename, int mode, *TSTextLogObject* \*new\_log\_obj)**

  - ***TSReturnCode* TSTextLogObjectWrite(*TSTextLogObject* the\_object, const char \*format, ...)**

  - **void TSTextLogObjectFlush(*TSTextLogObject* the\_object)**

  - ***TSReturnCode* TSTextLogObjectDestroy(*TSTextLogObject* the\_object)**

  - **void TSTextLogObjectHeaderSet(*TSTextLogObject* the\_object, const char \*header)**

  - ***TSReturnCode* TSTextLogObjectRollingEnabledSet(*TSTextLogObject* the\_object, int rolling\_enabled)**

  - **void TSTextLogObjectRollingIntervalSecSet(*TSTextLogObject* the\_object, int rolling\_interval\_sec)**

  - **void TSTextLogObjectRollingOffsetHrSet(*TSTextLogObject* the\_object, int rolling\_offset\_hr)**

  - **void TSTextLogObjectRollingSizeMbSet(*TSTextLogObject* the\_object, int rolling\_size\_mb)**

  ## DESCRIPTION

*TSTextLogObjectRollingEnabledSet()* sets the log rolling mode for the given object. This API must be used once the object is created and before writing into logs. The *rolling\_enabled* argument must be a valid *proxy.config.log.rolling\_enabled* values. If *TSTextLogObjectRollingEnabledSet()* is never called, the log object takes it's log rolling mode from the global *proxy.config.log.rolling\_enabled* setting.

It's also important to call *TSTextLogObjectRollingEnabledSet()* before any of the other APIs that modifies the rolling object. This is due to the fact that this API dictates which rolling mode should be used, and therefore affects further modifications of the logging object.

## SEE ALSO

**[TSAPI(3ts)](/TSAPI/3ts.md)**

## COPYRIGHT

2026, dev@trafficserver.apache.org
