autohost
Advanced tools
Comparing version 1.1.0 to 1.2.0
## 1.x | ||
### 1.2.0 | ||
* Fixed tests for new enable value. | ||
* Changed to an enable flag, enableAccessLogs, that defaults to true when undefined. | ||
* Add option to disable access logs | ||
### 1.1.0 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "autohost", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Resource driven, transport agnostic host", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -75,2 +75,3 @@ # autohost | ||
enableAccessLogs: true,// enables access logs | ||
logging: {}, // configuration passed to autohost's whistlepunk instance | ||
@@ -77,0 +78,0 @@ fount: undefined, // pass the app's fount instance to autohost |
@@ -113,3 +113,3 @@ var _ = require( 'lodash' ); | ||
var elapsed; | ||
var metricKey = req._metricKey; | ||
@@ -134,15 +134,17 @@ if ( metricKey ) { | ||
log.info( '%s@%s %s (%d ms) [%s] %s %s (%d bytes) %s %s (%d bytes)', | ||
process.title, | ||
hostName, | ||
ip, | ||
elapsed, | ||
user || 'anonymous', | ||
method, | ||
url, | ||
read, | ||
code, | ||
message || '', | ||
sent | ||
); | ||
if( state.config.enableAccessLogs ) { | ||
log.info( '%s@%s %s (%d ms) [%s] %s %s (%d bytes) %s %s (%d bytes)', | ||
process.title, | ||
hostName, | ||
ip, | ||
elapsed, | ||
user || 'anonymous', | ||
method, | ||
url, | ||
read, | ||
code, | ||
message || '', | ||
sent | ||
); | ||
} | ||
} ); | ||
@@ -149,0 +151,0 @@ next(); |
@@ -22,2 +22,5 @@ var _ = require( 'lodash' ); | ||
} ); | ||
if( typeof config.enableAccessLogs === "undefined") { | ||
config.enableAccessLogs = true; | ||
} | ||
authProvider = authProvider || config.authProvider; | ||
@@ -24,0 +27,0 @@ if ( config.logging && !_.isEmpty( config.logging ) ) { |
160093
2631
810