[Groonga-commit] droonga/droonga-http-server at 2845c43 [master] Allow to specify system log level

Back to archive index

SHIMODA Piro Hiroshi null+****@clear*****
Mon Oct 6 16:57:58 JST 2014


SHIMODA "Piro" Hiroshi	2014-10-06 16:57:58 +0900 (Mon, 06 Oct 2014)

  New Revision: 2845c43ca52eccd45dd15da8c98fcae23167d42d
  https://github.com/droonga/droonga-http-server/commit/2845c43ca52eccd45dd15da8c98fcae23167d42d

  Message:
    Allow to specify system log level

  Modified files:
    bin/droonga-http-server
    bin/droonga-http-server-configure
    lib/default-configs.js
    lib/server-options.js

  Modified: bin/droonga-http-server (+7 -0)
===================================================================
--- bin/droonga-http-server    2014-10-03 17:06:32 +0900 (adf7830)
+++ bin/droonga-http-server    2014-10-06 16:57:58 +0900 (80a1865)
@@ -23,6 +23,10 @@ if (options.daemon) {
   daemon();
 }
 
+
+if (options.systemLogLevel)
+  winston.setLevels(options.systemLogLevel);
+
 var logger;
 if (options.systemLogFile && options.systemLogFile != '-') {
   options.systemLogFile = path.resolve(baseDir, options.systemLogFile);
@@ -43,6 +47,9 @@ if (options.systemLogFile && options.systemLogFile != '-') {
     transports: transports
   });
 }
+logger.trace = function() { // alias
+  this.silly.apply(this, arguments);
+};
 
 if (options.pidFile) {
   options.pidFile = path.resolve(baseDir, options.pidFile);

  Modified: bin/droonga-http-server-configure (+1 -0)
===================================================================
--- bin/droonga-http-server-configure    2014-10-03 17:06:32 +0900 (42e2792)
+++ bin/droonga-http-server-configure    2014-10-06 16:57:58 +0900 (8b6104f)
@@ -278,6 +278,7 @@ function tryResetConfigs() {
       .then(function() { return setStringOption('defaultDataset', 'default dataset'); })
       .then(function() { return setStringOption('accessLogFile', 'path to the access log file'); })
       .then(function() { return setStringOption('systemLogFile', 'path to the system log file'); })
+      .then(function() { return setStringOption('systemLogLevel', 'log level for the system log'); })
       .then(function() { return setIntegerOption('cacheSize', 'maximum size of the response cache'); })
       .then(function() { return setBooleanOption('enableTrustProxy', 'enable "trust proxy" configuration'); })
       .then(function() { return setStringOption('environment', 'environment'); })

  Modified: lib/default-configs.js (+1 -0)
===================================================================
--- lib/default-configs.js    2014-10-03 17:06:32 +0900 (7b2dae1)
+++ lib/default-configs.js    2014-10-06 16:57:58 +0900 (9735240)
@@ -74,6 +74,7 @@ if (configs.daemon) {
   define(configs, 'access_log_file', '-');
   define(configs, 'system_log_file', '-');
 }
+define(configs, 'system_log_level', 'warn');
 
 define(configs, 'engine.host',            engineConfigs.host);
 define(configs, 'engine.port',            engineConfigs.port);

  Modified: lib/server-options.js (+7 -0)
===================================================================
--- lib/server-options.js    2014-10-03 17:06:32 +0900 (099be9f)
+++ lib/server-options.js    2014-10-06 16:57:58 +0900 (d1fe5b0)
@@ -6,6 +6,7 @@ var defaultConfigs = require('./default-configs');
 options.port             = defaultConfigs.port;
 options.accessLogFile    = defaultConfigs.access_log_file;
 options.systemLogFile    = defaultConfigs.system_log_file;
+options.systemLogLevel   = defaultConfigs.system_log_level;
 options.daemon           = defaultConfigs.daemon;
 options.pidFile          = defaultConfigs.pid_file
 options.cacheSize        = defaultConfigs.cache_size;
@@ -96,6 +97,12 @@ function define() {
       generateOptionHandler(function() {
         options.systemLogFileGiven = true;
       }));
+  add('--system-log-level <level>',
+      'Log level for the system log. ' +
+        '(' + options.systemLogLevel + ')',
+      generateOptionHandler(function() {
+        options.systemLogLevelGiven = true;
+      }));
   add('--cache-size <size>',
       'The max number of cached requests ' +
         '(' + options.cacheSize + ')',
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index