Skip to content

Commit

Permalink
Removing time from log (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Johansen authored Mar 30, 2020
1 parent 2df3835 commit 7b0d3dd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/logger.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const logger = require('pino')({
timestamp: false,
});

module.exports = logger;


2 changes: 1 addition & 1 deletion src/routes/collect.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const forwardEvents = require('../forward-events');
const isBot = require('isbot');
const paths = require('../paths');
const constants = require('../constants');
const logger = require('pino')();
const logger = require('../logger');

const handler = function(request, reply) {
const events = JSON.parse(request.body.e);
Expand Down
2 changes: 1 addition & 1 deletion src/routes/verify-logs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const logger = require('pino')();
const logger = require('../logger');
module.exports = function(req, reply) {
logger.info({
msg: "Request with user agent: " + req.user_agent + " was blocked.",
Expand Down
2 changes: 1 addition & 1 deletion src/server.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fastify = require('fastify')({logger: false});
const path = require('path');
const logger = require('pino')();
const logger = require('./logger');
const paths = require('./paths');
fastify.register(require('fastify-formbody'));
fastify.register(require('fastify-cors'), {origin: '*'});
Expand Down

0 comments on commit 7b0d3dd

Please sign in to comment.