Structured logging (attempt 2) (#1234)
* Revert "Revert "feat(structured logging): implements structured logging for backend (#1217)" (#1227)"
This reverts commit 63e6581162.
* Use pino-http instead of express pino logger
* Use correct reference to knex and do not instantiate HttpLogger prematurely
* Adds missing dependency for pino to webhook-service
* Do not instantiate middleware when passed to express
* Refactor to move logging into shared
* Copy shared packages into dockerfiles
* Build shared workspace in docker build-stage for fileimport & webhook
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
'use strict'
|
||||
const zlib = require('zlib')
|
||||
const cors = require('cors')
|
||||
const debug = require('debug')
|
||||
|
||||
const { validatePermissionsWriteStream } = require('./authUtils')
|
||||
|
||||
const { hasObjects } = require('../services/objects')
|
||||
const { logger } = require('@/logging/logging')
|
||||
|
||||
module.exports = (app) => {
|
||||
app.options('/api/diff/:streamId', cors())
|
||||
@@ -21,7 +21,7 @@ module.exports = (app) => {
|
||||
|
||||
const objectList = JSON.parse(req.body.objects)
|
||||
|
||||
debug('speckle:info')(
|
||||
logger.info(
|
||||
`[User ${req.context.userId || '-'}] Diffing ${
|
||||
objectList.length
|
||||
} objects for stream ${req.params.streamId}`
|
||||
@@ -31,7 +31,7 @@ module.exports = (app) => {
|
||||
streamId: req.params.streamId,
|
||||
objectIds: objectList
|
||||
})
|
||||
// console.log(response)
|
||||
// logger.debug(response)
|
||||
res.writeHead(200, {
|
||||
'Content-Encoding': 'gzip',
|
||||
'Content-Type': 'application/json'
|
||||
|
||||
Reference in New Issue
Block a user