Display the request method in the log: don't assume GET
This commit is contained in:
parent
f1b7dd2a9d
commit
fefcf3522e
1 changed files with 3 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue