Display the request method in the log: don't assume GET

This commit is contained in:
Misha Wolfson 2016-12-15 17:56:28 -05:00
parent f420e045be
commit 5a67343957

View file

@ -77,12 +77,13 @@ var spserver = function (settings) {
var base = generateBase(path.resolve(finalSettings.file), finalSettings);
var server = http.createServer(function (req, res) {
logger.debug('[REQ] GET:', req.url);
logger.debug('[REQ]', req.method + ':', req.url);
var startTime = new Date().getTime();
var done = function () {
var requestTime = new Date().getTime() - startTime;
logger.debug('[RES] GET:', req.url, '(' + res.statusCode + ') took', requestTime, 'ms');
logger.debug('[RES]', req.method + ':', req.url,
'(' + res.statusCode + ')', 'took', requestTime, 'ms');
};
res.addListener('finish', done);