PostHogLogsConfig
Properties
| Name | Type |
|---|---|
beforeSend | BeforeSendLogFn | BeforeSendLogFn[] |
Pre-send filter. See for shape and examples. Configure as a single function or a chain. | |
environment | string |
Deployment environment attached as OTLP | |
flushIntervalMs | number |
How often the periodic background flush fires (ms). Records also flush eagerly when the buffer fills, on AppState changes (RN), and on | |
maxBatchRecordsPerPost | number |
Max records per outbound POST. Keeps each request under the server's 2 MB cap. On a 413 response, the SDK halves this value, retries the same records, then ramps back up by 1 per healthy send. A 413 on a single-record batch drops the record (it's larger than the server can accept regardless of batch size). Default: 50 (RN) / 100 (browser). | |
maxBufferSize | number |
Max records held in memory before the queue evicts the oldest on push (FIFO). Bounds memory footprint and on-disk-queue size. When the buffer hits this size, an immediate flush is triggered to reclaim space; if the flush hasn't completed before the next capture, the oldest record is shifted out. Default: 100. | |
rateCap | {
maxLogs?: number;
windowMs?: number;
} |
Tumbling-window rate cap. Bounds how many records can be captured within a sliding (technically tumbling) time window. Records exceeding the cap are dropped synchronously at | |
resourceAttributes | Record<string, LogAttributeValue> |
Extra OTLP resource attributes attached to every record. Spread first; SDK-controlled keys ( | |
serviceName | string |
Service name attached to every record as the OTLP | |
serviceVersion | string |
Service version attached as OTLP | |