Compare commits
No commits in common. "cdb-precise-timing" and "master" have entirely different histories.
cdb-precis
...
master
@ -85,9 +85,7 @@ function configure(config, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function shutdown(cb) {
|
function shutdown(cb) {
|
||||||
var filesToClose = openFiles;
|
async.each(openFiles, function(file, done) {
|
||||||
openFiles = [];
|
|
||||||
async.each(filesToClose, function(file, done) {
|
|
||||||
if (!file.write(eol, "utf-8")) {
|
if (!file.write(eol, "utf-8")) {
|
||||||
file.once('drain', function() {
|
file.once('drain', function() {
|
||||||
file.end(done);
|
file.end(done);
|
||||||
|
@ -54,7 +54,7 @@ function getLogger(logger4js, options) {
|
|||||||
if (nolog && nolog.test(req.originalUrl)) return next();
|
if (nolog && nolog.test(req.originalUrl)) return next();
|
||||||
if (thislogger.isLevelEnabled(level) || options.level === 'auto') {
|
if (thislogger.isLevelEnabled(level) || options.level === 'auto') {
|
||||||
|
|
||||||
var start = process.hrtime()
|
var start = new Date()
|
||||||
, statusCode
|
, statusCode
|
||||||
, writeHead = res.writeHead
|
, writeHead = res.writeHead
|
||||||
, url = req.originalUrl;
|
, url = req.originalUrl;
|
||||||
@ -81,8 +81,7 @@ function getLogger(logger4js, options) {
|
|||||||
|
|
||||||
//hook on end request to emit the log entry of the HTTP request.
|
//hook on end request to emit the log entry of the HTTP request.
|
||||||
res.on('finish', function() {
|
res.on('finish', function() {
|
||||||
var end = process.hrtime();
|
res.responseTime = new Date() - start;
|
||||||
res.responseTime = (end[0] - start[0]) * 1000 + (end[1] - start[1]) / 1000000;
|
|
||||||
//status code response level handling
|
//status code response level handling
|
||||||
if(res.statusCode && options.level === 'auto'){
|
if(res.statusCode && options.level === 'auto'){
|
||||||
level = levels.INFO;
|
level = levels.INFO;
|
||||||
|
@ -219,11 +219,6 @@ function clearAppenders () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearAndShutdownAppenders(cb) {
|
|
||||||
clearAppenders();
|
|
||||||
shutdownAppenders(cb);
|
|
||||||
}
|
|
||||||
|
|
||||||
function configureAppenders(appenderList, options) {
|
function configureAppenders(appenderList, options) {
|
||||||
clearAppenders();
|
clearAppenders();
|
||||||
if (appenderList) {
|
if (appenderList) {
|
||||||
@ -433,10 +428,7 @@ function shutdown(cb) {
|
|||||||
// First, disable all writing to appenders. This prevents appenders from
|
// First, disable all writing to appenders. This prevents appenders from
|
||||||
// not being able to be drained because of run-away log writes.
|
// not being able to be drained because of run-away log writes.
|
||||||
loggerModule.disableAllLogWrites();
|
loggerModule.disableAllLogWrites();
|
||||||
shutdownAppenders(cb);
|
|
||||||
}
|
|
||||||
|
|
||||||
function shutdownAppenders(cb) {
|
|
||||||
// Next, get all the shutdown functions for appenders as an array.
|
// Next, get all the shutdown functions for appenders as an array.
|
||||||
var shutdownFunctions = Object.keys(appenderShutdowns).reduce(
|
var shutdownFunctions = Object.keys(appenderShutdowns).reduce(
|
||||||
function(accum, category) {
|
function(accum, category) {
|
||||||
@ -462,7 +454,6 @@ module.exports = {
|
|||||||
addAppender: addAppender,
|
addAppender: addAppender,
|
||||||
loadAppender: loadAppender,
|
loadAppender: loadAppender,
|
||||||
clearAppenders: clearAppenders,
|
clearAppenders: clearAppenders,
|
||||||
clearAndShutdownAppenders: clearAndShutdownAppenders,
|
|
||||||
configure: configure,
|
configure: configure,
|
||||||
shutdown: shutdown,
|
shutdown: shutdown,
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user