Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update logs.md #155

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/ios/open-source/getting-started/logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,17 @@ For example, if you have a steady rate of 1% for a given logEvent, then you can

## Best Practices

Embrace's Log Message API is immediate mode.

A call to this API results in a networking call between your app and Embrace's servers immediately.
This can have a negative effect on your application's performance or battery life when over-used.
It can also be an invaluable tool for getting information about your application quickly.

### Log Batching
To reduce the device and network overhead. We batch logs according to the following critera:
- A maximum of **2 seconds** between logs: After receiving a log, we wait for 2 seconds. If no additional log arrives during that period, we send it to the backend.
- A maximum of **5 seconds** for batch lifetime: Log batches should not exist for more than 5 seconds. This complements the previous logic to prevent accumulation of logs (for example, if someone adds a log every 1 second).
- A maximum of **50 logs** per batch: This final rule prevents issues with large batches. If many logs are created in a short period (less than the batch lifetime), the batch will be sent.


:::info
For more tips on making the most of the Log Message API, checkout the [Best Practices](/best-practices/log-message-api).
:::
Loading