Skip to content

Conversation

@rkistner
Copy link
Contributor

@rkistner rkistner commented Jul 17, 2024

This additionally adds some additional fields to structured logs, for easier processing if desired.

Sample log output for a single HTTP request:

info: New checkpoint: 2686394 | write: null | buckets: 2 ["global[]","by_user[\"test\"]"] {"buckets":2,"checkpoint":"2686394","user_id":"test"}
info: Sync stream complete {"data_synced_bytes":14291587,"operations_synced":2402,"user_id":"test"}
info: POST /sync/stream {"duration_ms":181,"method":"POST","path":"/sync/stream","route":"/sync/stream","status":200}

JSON log format:

{"buckets":2,"checkpoint":"2686394","level":"info","message":"New checkpoint: 2686394 | write: null | buckets: 2 [\"global[]\",\"by_user[\\\"test\\\"]\"]","timestamp":"2024-07-17T09:05:33.532Z","user_id":"test"}
{"data_synced_bytes":14291587,"level":"info","message":"Sync stream complete","operations_synced":2402,"timestamp":"2024-07-17T09:05:33.780Z","user_id":"test"}
{"duration_ms":252,"level":"info","message":"POST /sync/stream","method":"POST","path":"/sync/stream","route":"/sync/stream","status":200,"timestamp":"2024-07-17T09:05:33.780Z"}

@rkistner rkistner requested a review from stevensJourney July 17, 2024 09:07
@changeset-bot
Copy link

changeset-bot bot commented Jul 17, 2024

🦋 Changeset detected

Latest commit: bdbf95c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@powersync/service-core Patch
@powersync/service-image Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Collaborator

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome

@rkistner rkistner merged commit 8e9a316 into main Jul 18, 2024
@rkistner rkistner deleted the sync-stats branch July 18, 2024 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants