diff --git a/config/environments/development.js.example b/config/environments/development.js.example index 7004c9ec..c7c3b97e 100644 --- a/config/environments/development.js.example +++ b/config/environments/development.js.example @@ -87,6 +87,7 @@ var config = { // there, in append mode. Otherwise stdout is used (default). // Log file will be re-opened on receiving the HUP signal ,log_filename: undefined + ,log_windshaft: true // Templated database username for authorized user // Supported labels: 'user_id' (read from redis) ,postgres_auth_user: 'development_cartodb_user_<%= user_id %>' diff --git a/config/environments/production.js.example b/config/environments/production.js.example index 3e75a897..5b6a632b 100644 --- a/config/environments/production.js.example +++ b/config/environments/production.js.example @@ -87,6 +87,7 @@ var config = { // there, in append mode. Otherwise stdout is used (default). // Log file will be re-opened on receiving the HUP signal ,log_filename: 'logs/node-windshaft.log' + ,log_windshaft: true // Templated database username for authorized user // Supported labels: 'user_id' (read from redis) ,postgres_auth_user: 'cartodb_user_<%= user_id %>' diff --git a/config/environments/staging.js.example b/config/environments/staging.js.example index 49e08ac7..1aa59d02 100644 --- a/config/environments/staging.js.example +++ b/config/environments/staging.js.example @@ -87,6 +87,7 @@ var config = { // there, in append mode. Otherwise stdout is used (default). // Log file will be re-opened on receiving the HUP signal ,log_filename: 'logs/node-windshaft.log' + ,log_windshaft: true // Templated database username for authorized user // Supported labels: 'user_id' (read from redis) ,postgres_auth_user: 'cartodb_staging_user_<%= user_id %>' diff --git a/config/environments/test.js.example b/config/environments/test.js.example index 04797ae9..d8207730 100644 --- a/config/environments/test.js.example +++ b/config/environments/test.js.example @@ -87,6 +87,7 @@ var config = { // there, in append mode. Otherwise stdout is used (default). // Log file will be re-opened on receiving the HUP signal ,log_filename: '/tmp/node-windshaft.log' + ,log_windshaft: true // Templated database username for authorized user // Supported labels: 'user_id' (read from redis) ,postgres_auth_user: 'test_windshaft_cartodb_user_<%= user_id %>' diff --git a/lib/api/api-router.js b/lib/api/api-router.js index f72081be..1c74420a 100644 --- a/lib/api/api-router.js +++ b/lib/api/api-router.js @@ -83,10 +83,11 @@ module.exports = class ApiRouter { const metadataBackend = cartodbRedis({ pool: redisPool }); const pgConnection = new PgConnection(metadataBackend); + const windshaftLogger = environmentOptions.log_windshaft ? global.log4js.getLogger('[windshaft]') : null const mapStore = new windshaft.storage.MapStore({ pool: redisPool, expire_time: serverOptions.grainstore.default_layergroup_ttl, - logger: global.log4js.getLogger('[windshaft]') + logger: windshaftLogger }); const rendererFactory = createRendererFactory({ redisPool, serverOptions, environmentOptions });