[Groonga-commit] groonga/gcs [master] Accept pathes of log files by command line options and environment variables

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Nov 1 17:18:17 JST 2012


YUKI Hiroshi	2012-11-01 17:18:17 +0900 (Thu, 01 Nov 2012)

  New Revision: d79c43edab0e4a320096cbcf247c6393b8311309
  https://github.com/groonga/gcs/commit/d79c43edab0e4a320096cbcf247c6393b8311309

  Log:
    Accept pathes of log files by command line options and environment variables

  Modified files:
    bin/gcs
    lib/command-line.js
    packages/debian/gcs.default
    packages/debian/gcs.init
    packages/debian/gcs.upstart

  Modified: bin/gcs (+21 -0)
===================================================================
--- bin/gcs    2012-11-01 17:13:15 +0900 (51beb14)
+++ bin/gcs    2012-11-01 17:18:17 +0900 (ccc7855)
@@ -11,10 +11,31 @@ commandLine
             '[' + CLI.defaultPrivilegedRanges + ']',
           String,
           CLI.defaultPrivilegedRanges)
+  .option('--access-log-path <path>',
+          'path to the access log' +
+            '(GCS_ACCESS_LOG_PATH) ' +
+            '[' + CLI.defaultAccessLogPath + ']',
+          String,
+          CLI.defaultAccessLogPath)
+  .option('--query-log-path <path>',
+          'path to the query log' +
+            '(GCS_QUERY_LOG_PATH) ' +
+            '[' + CLI.defaultQueryLogPath + ']',
+          String,
+          CLI.defaultQueryLogPath)
+  .option('--error-log-path <path>',
+          'path to the error log' +
+            '(GCS_ERROR_LOG_PATH) ' +
+            '[' + CLI.defaultErrorLogPath + ']',
+          String,
+          CLI.defaultErrorLogPath)
   .parse();
 
 var server = gcsServer.createServer({
       databasePath:      commandLine.options.databasePath,
+      accessLogPath:     commandLine.options.accessLogPath,
+      queryLogPath:      commandLine.options.queryLogPath,
+      errorLogPath:      commandLine.options.errorLogPath,
       privilegedRanges:  commandLine.options.privilege,
       port:              commandLine.port,
       baseHost:          commandLine.baseHost,

  Modified: lib/command-line.js (+9 -0)
===================================================================
--- lib/command-line.js    2012-11-01 17:13:15 +0900 (e94e87f)
+++ lib/command-line.js    2012-11-01 17:18:17 +0900 (9defbf9)
@@ -5,6 +5,15 @@ var path = require('path');
 var defaultDatabasePath =
       exports.defaultDatabasePath =
       CommandLineInterface.defaultDatabasePath = process.env.GCS_DATABASE_PATH || process.env.HOME + '/.gcs/database/gcs';
+var defaultAccessLogPath =
+      exports.defaultAccessLogPath =
+      CommandLineInterface.defaultAccessLogPath = process.env.GCS_ACCESS_LOG_PATH;
+var defaultQueryLogPath =
+      exports.defaultQueryLogPath =
+      CommandLineInterface.defaultQueryLogPath = process.env.GCS_QUERY_LOG_PATH;
+var defaultErrorLogPath =
+      exports.defaultErrorLogPath =
+      CommandLineInterface.defaultErrorLogPath = process.env.GCS_ERROR_LOG_PATH;
 var defaultPort =
       exports.defaultPort =
       CommandLineInterface.defaultPort = process.env.GCS_PORT || 7575;

  Modified: packages/debian/gcs.default (+9 -0)
===================================================================
--- packages/debian/gcs.default    2012-11-01 17:13:15 +0900 (f862eaf)
+++ packages/debian/gcs.default    2012-11-01 17:18:17 +0900 (9a1745d)
@@ -7,6 +7,15 @@
 # The location of the database
 GCS_DATABASE_PATH=$(echo ~gcs)/.gcs/database/gcs
 
+# The location of the access log
+GCS_ACCESS_LOG_PATH=/var/log/gcs/access.log
+
+# The location of the query log
+GCS_QUERY_LOG_PATH=/var/log/gcs/query.log
+
+# The location of the error log
+GCS_ERROR_LOG_PATH=/var/log/gcs/error.log
+
 # The port number to listen
 GCS_PORT=7575
 

  Modified: packages/debian/gcs.init (+3 -0)
===================================================================
--- packages/debian/gcs.init    2012-11-01 17:13:15 +0900 (5265324)
+++ packages/debian/gcs.init    2012-11-01 17:18:17 +0900 (fe4c1fd)
@@ -42,6 +42,9 @@ DEFAULT_FILE=/etc/default/$NAME
 # Read configuration variable file if it is present
 [ -r $DEFAULT_FILE ] && . $DEFAULT_FILE
 export GCS_DATABASE_PATH
+export GCS_ACCESS_LOG_PATH
+export GCS_QUERY_LOG_PATH
+export GCS_ERROR_LOG_PATH
 export GCS_PORT
 export GCS_BASE_HOST
 export GCS_PRIVILEGED_RANGES

  Modified: packages/debian/gcs.upstart (+3 -0)
===================================================================
--- packages/debian/gcs.upstart    2012-11-01 17:13:15 +0900 (98b372d)
+++ packages/debian/gcs.upstart    2012-11-01 17:18:17 +0900 (118b594)
@@ -16,6 +16,9 @@ script
   DEFAULT_FILE=/etc/default/gcs
   [ -r $DEFAULT_FILE ] && . $DEFAULT_FILE
   export GCS_DATABASE_PATH
+  export GCS_ACCESS_LOG_PATH
+  export GCS_QUERY_LOG_PATH
+  export GCS_ERROR_LOG_PATH
   export GCS_PORT
   export GCS_BASE_HOST
   export GCS_PRIVILEGED_RANGES
-------------- next part --------------
HTML����������������������������...
Download 



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