request param to log
This commit is contained in:
@@ -56,7 +56,7 @@ class Config {
|
|||||||
return el != null;
|
return el != null;
|
||||||
})
|
})
|
||||||
if (this.requires.length) {
|
if (this.requires.length) {
|
||||||
logger.debug('Process terminated invalid required arguments: ', JSON.stringify(requires))
|
logger.debug('Process terminated invalid required arguments: ', JSON.stringify(this.requires))
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
8
index.js
8
index.js
@@ -12,13 +12,17 @@ logger.getContext = function getContext() {
|
|||||||
return {
|
return {
|
||||||
// hostname: hostname,
|
// hostname: hostname,
|
||||||
// pid: process.pid,
|
// pid: process.pid,
|
||||||
port: port,
|
// port: port,
|
||||||
app: 'Headless'
|
app: 'Browser'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
var app = express();
|
var app = express();
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
app.use(expressLogging(logger));
|
app.use(expressLogging(logger));
|
||||||
|
app.use((req, res, next) => {
|
||||||
|
logger.debug(Object.assign(req.body, req.query, req.params), 'Request params')
|
||||||
|
next()
|
||||||
|
})
|
||||||
app.listen(port, () => {
|
app.listen(port, () => {
|
||||||
logger.info({ app: 'Headless browser' }, 'Startup');
|
logger.info({ app: 'Headless browser' }, 'Startup');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user