Skip to content

Commit

Permalink
chore: add the node version to the logger output (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
lholmquist committed Mar 14, 2023
1 parent 3a689af commit 8cdb40e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion index.js
Expand Up @@ -27,7 +27,18 @@ function start(func, options) {

// Create the server
const { logLevel = LOG_LEVEL, port = PORT } = { ...options };
const server = fastify({ logger: { level: logLevel } });
const server = fastify({
logger: {
level: logLevel,
formatters: {
bindings: bindings => ({
pid: bindings.pid,
hostname: bindings.hostname,
node_version: process.version
})
}
}
});

server.addContentTypeParser('application/x-www-form-urlencoded',
function(_, payload, done) {
Expand Down

0 comments on commit 8cdb40e

Please sign in to comment.