mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-01-04 07:02:45 +08:00
simple api log
This commit is contained in:
parent
3d8122fa4a
commit
f44aa6f655
1 changed files with 5 additions and 1 deletions
6
api.js
6
api.js
|
@ -60,7 +60,6 @@ server.use((req, res, next) => {
|
|||
if (req.route.path === '/users/:user/updates') {
|
||||
req.headers['accept-encoding'] = '';
|
||||
}
|
||||
log.http(req.method, req.url);
|
||||
next();
|
||||
});
|
||||
server.use(restify.plugins.gzipResponse());
|
||||
|
@ -145,6 +144,11 @@ module.exports = done => {
|
|||
submitRoutes(db, server, messageHandler, userHandler);
|
||||
domainaliasRoutes(db, server);
|
||||
|
||||
server.use((req, res, next) => {
|
||||
log.http(req.method, '%s - %s %s', req.url, res.statusCode, req.connection.remoteAddress);
|
||||
next();
|
||||
});
|
||||
|
||||
server.on('error', err => {
|
||||
if (!started) {
|
||||
started = true;
|
||||
|
|
Loading…
Reference in a new issue