Display the request method in the log: don't assume GET
This commit is contained in:
parent
f420e045be
commit
5a67343957
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 base = generateBase(path.resolve(finalSettings.file), finalSettings);
|
||||||
|
|
||||||
var server = http.createServer(function (req, res) {
|
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 startTime = new Date().getTime();
|
||||||
|
|
||||||
var done = function () {
|
var done = function () {
|
||||||
var requestTime = new Date().getTime() - startTime;
|
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);
|
res.addListener('finish', done);
|
||||||
|
|
Loading…
Reference in a new issue