Skip to content

Commit 84bdb61

Browse files
watsonv1v
authored andcommitted
fix: change logUncaughtExceptions default to false (elastic#1432)
Even though it would be best to log stack traces of uncaught exception to STDERR by default, this would be a breaking change. To land this feature in the current major, we'll change the default to be `false`.
1 parent d4f1820 commit 84bdb61

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

docs/configuration.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,11 @@ Whether or not the agent should monitor for uncaught exceptions and send them to
389389
==== `logUncaughtExceptions`
390390

391391
* *Type:* Boolean
392-
* *Default:* `true`
392+
* *Default:* `false`
393393
* *Env:* `ELASTIC_APM_LOG_UNCAUGHT_EXCEPTIONS`
394394

395-
By default the stack trace of uncaught exceptions is written to STDERR.
396-
Set this config option to `false` to turn this behaviour off.
395+
By default the stack trace of a uncaught exception is not written to STDERR when the agent is active.
396+
Set this config option to `true` to have the agent write stack traces of uncaught exceptions to STDERR.
397397

398398
[[capture-error-log-stack-traces]]
399399
==== `captureErrorLogStackTraces`

lib/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ var DEFAULTS = {
6060
kubernetesPodName: undefined,
6161
kubernetesPodUID: undefined,
6262
logLevel: 'info',
63-
logUncaughtExceptions: true,
63+
logUncaughtExceptions: false, // TODO: Change to `true` in the v4.0.0
6464
metricsInterval: '30s',
6565
metricsLimit: 1000,
6666
serverTimeout: '30s',

test/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var optionFixtures = [
5353
['kubernetesPodName', 'KUBERNETES_POD_NAME'],
5454
['kubernetesPodUID', 'KUBERNETES_POD_UID'],
5555
['logLevel', 'LOG_LEVEL', 'info'],
56-
['logUncaughtExceptions', 'LOG_UNCAUGHT_EXCEPTIONS', true],
56+
['logUncaughtExceptions', 'LOG_UNCAUGHT_EXCEPTIONS', false],
5757
['metricsInterval', 'METRICS_INTERVAL', 30],
5858
['metricsLimit', 'METRICS_LIMIT', 1000],
5959
['secretToken', 'SECRET_TOKEN'],

test/uncaught-exceptions/log-uncaught-exceptions-off.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
const agent = require('../..').start({
44
metricsInterval: 0,
5-
centralConfig: false,
6-
logUncaughtExceptions: false
5+
centralConfig: false
76
})
87

98
const test = require('tape')

test/uncaught-exceptions/log-uncaught-exceptions-on.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
const agent = require('../..').start({
44
metricsInterval: 0,
5-
centralConfig: false
5+
centralConfig: false,
6+
logUncaughtExceptions: true
67
})
78

89
const test = require('tape')

0 commit comments

Comments
 (0)