зеркало из https://github.com/mozilla/fxa.git
Merge pull request mozilla/fxa-auth-server#13 from mozilla/monitor
use monitoring plugin and log error responses
This commit is contained in:
Коммит
add9c38595
|
@ -25,7 +25,8 @@
|
|||
"hoek": "0.8.5",
|
||||
"uuid": "1.4.1",
|
||||
"async": "0.2.8",
|
||||
"kvstore": "git://github.com/mozilla/node-kvstore.git#4b8c2f6763"
|
||||
"kvstore": "git://github.com/mozilla/node-kvstore.git#4b8c2f6763",
|
||||
"good": "0.5.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"awsbox": "0.4.x",
|
||||
|
|
|
@ -34,6 +34,30 @@ server.ext(
|
|||
}
|
||||
);
|
||||
|
||||
server.ext('onPreResponse', function (request, next) {
|
||||
var response = request.response();
|
||||
if (response.isBoom) {
|
||||
server.log(['error'],
|
||||
response.response.code + ' ' +
|
||||
response.response.payload.error + ': ' +
|
||||
response.message);
|
||||
server.log(['info'], 'request payload: ' + JSON.stringify(request.payload));
|
||||
}
|
||||
|
||||
next();
|
||||
});
|
||||
|
||||
server.pack.require('good', {
|
||||
subscribers: {
|
||||
console: ['ops', 'request', 'log']
|
||||
},
|
||||
extendedRequests: true,
|
||||
leakDetection: true
|
||||
},
|
||||
function(err) {
|
||||
if (err) server.log(['error'], err);
|
||||
});
|
||||
|
||||
//TODO throttle extension
|
||||
//TODO toobusy extension
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче