Skip to content

Commit

Permalink
Add FAQ question on zap dropping logs due to sampling (#875)
Browse files Browse the repository at this point in the history
Multiple issues have been opened about missing logs (e.g., #874, #588).

While sampling is mentioned in the API documentation for `NewProductionConfig`,
it may help to add an FAQ question as well.
  • Loading branch information
prashantv committed Nov 12, 2020
1 parent 404189c commit 9d2e5de
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions FAQ.md
Expand Up @@ -27,6 +27,13 @@ abstraction, and it lets us add methods without introducing breaking changes.
Your applications should define and depend upon an interface that includes
just the methods you use.

### Why are some of my logs missing?

Logs are dropped intentionally by zap when sampling is enabled. The production
configuration (as returned by `NewProductionConfig()` enables sampling which will
cause repeated logs within a second to be sampled. See more details on why sampling
is enabled in [Why sample application logs](https://github.com/uber-go/zap/blob/master/FAQ.md#why-sample-application-logs).

### Why sample application logs?

Applications often experience runs of errors, either because of a bug or
Expand Down

0 comments on commit 9d2e5de

Please sign in to comment.