Skip to content

Commit 8bceffd

Browse files
authored
[DI] Improve logging in integration tests (#5610)
The Dynamic Instrumentation integration tests uses Fastify in some of the instrumented test apps. We've seen issues in CI where the inspected application exits with exit code 1, but there's no error message being logged. So it's not possible to see what caused the process to exit. By default Fastify doesn't log any messages to STDOUT/STDERR. This might be the reason why we only see the exit code, but not any error message. For better visibility into such errors in CI, this commit changes the default log level to `error`, so that errors are logged to STDERR.
1 parent b824aa4 commit 8bceffd

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

integration-tests/debugger/target-app/basic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require('dd-trace/init')
44
const Fastify = require('fastify')
55

6-
const fastify = Fastify()
6+
const fastify = Fastify({ logger: { level: 'error' } })
77

88
fastify.get('/foo/:name', function fooHandler (request) {
99
return { hello: request.params.name } // BREAKPOINT: /foo/bar

integration-tests/debugger/target-app/redact.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require('dd-trace/init')
44
const Fastify = require('fastify')
55

6-
const fastify = Fastify()
6+
const fastify = Fastify({ logger: { level: 'error' } })
77

88
fastify.get('/', function () {
99
/* eslint-disable no-unused-vars */

integration-tests/debugger/target-app/snapshot-pruning.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ require('dd-trace/init')
55
const { randomBytes } = require('crypto')
66
const Fastify = require('fastify')
77

8-
const fastify = Fastify()
8+
const fastify = Fastify({ logger: { level: 'error' } })
99

1010
const TARGET_SIZE = 1024 * 1024 // 1MB
1111
const LARGE_STRING = randomBytes(1024).toString('hex')

integration-tests/debugger/target-app/snapshot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require('dd-trace/init')
44
const Fastify = require('fastify')
55

6-
const fastify = Fastify()
6+
const fastify = Fastify({ logger: { level: 'error' } })
77

88
fastify.get('/:name', function handler (request) {
99
/* eslint-disable no-unused-vars */

integration-tests/debugger/target-app/template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ require('dd-trace/init')
44
const { inspect } = require('util')
55
const Fastify = require('fastify')
66

7-
const fastify = Fastify()
7+
const fastify = Fastify({ logger: { level: 'error' } })
88

99
const weakObj = {}
1010

0 commit comments

Comments
 (0)