Skip to content

Commit e9c5fc4

Browse files
authored
No longer send out empty log envelopes (#4497)
* Check log event count before sending envelope * changelog
1 parent 078e7fc commit e9c5fc4

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Fixes
6+
7+
- No longer send out empty log envelopes ([#4497](https://github.com/getsentry/sentry-java/pull/4497))
8+
39
## 8.14.0
410

511
### Fixes

sentry/src/main/java/io/sentry/logger/LoggerBatchProcessor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ private void flushBatch() {
101101
}
102102
} while (!queue.isEmpty() && logEvents.size() < MAX_BATCH_SIZE);
103103

104-
client.captureBatchedLogEvents(new SentryLogEvents(logEvents));
104+
if (!logEvents.isEmpty()) {
105+
client.captureBatchedLogEvents(new SentryLogEvents(logEvents));
106+
}
105107
}
106108

107109
private class BatchRunnable implements Runnable {

0 commit comments

Comments
 (0)