knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmin...@apache.org
Subject knox git commit: KNOX-538: Log some important system properties at startup
Date Mon, 04 May 2015 20:17:17 GMT
Repository: knox
Updated Branches:
  refs/heads/master e671df4c0 -> 895457d99


KNOX-538: Log some important system properties at startup


Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/895457d9
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/895457d9
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/895457d9

Branch: refs/heads/master
Commit: 895457d990bf012faced29121b8783d402393d3e
Parents: e671df4
Author: Kevin Minder <kevin.minder@hortonworks.com>
Authored: Mon May 4 16:17:14 2015 -0400
Committer: Kevin Minder <kevin.minder@hortonworks.com>
Committed: Mon May 4 16:17:14 2015 -0400

----------------------------------------------------------------------
 .../org/apache/hadoop/gateway/GatewayMessages.java     |  2 ++
 .../java/org/apache/hadoop/gateway/GatewayServer.java  | 13 +++++++++++++
 2 files changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/895457d9/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayMessages.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayMessages.java b/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayMessages.java
index a1c4828..452acad 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayMessages.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayMessages.java
@@ -352,4 +352,6 @@ public interface GatewayMessages {
   @Message( level = MessageLevel.DEBUG, text = "Added Service definition name: {0}, role
: {1}, version : {2}" )
   void addedServiceDefinition(String serviceName, String serviceRole, String version);
 
+  @Message( level = MessageLevel.INFO, text = "System Property: {0}={1}" )
+  void logSysProp( String name, String property );
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/895457d9/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java b/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
index 0072e7e..cf4b662 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
@@ -89,6 +89,7 @@ public class GatewayServer {
   public static void main( String[] args ) {
     try {
       configureLogging();
+      logSysProps();
       CommandLine cmd = GatewayCommandLine.parse( args );
       if( cmd.hasOption( GatewayCommandLine.HELP_LONG ) ) {
         GatewayCommandLine.printHelp();
@@ -156,6 +157,18 @@ public class GatewayServer {
     return services;
   }
 
+  private static void logSysProp( String name ) {
+    log.logSysProp( name, System.getProperty( name ) );
+  }
+
+  private static void logSysProps() {
+    logSysProp( "user.name" );
+    logSysProp( "user.dir" );
+    logSysProp( "java.runtime.name" );
+    logSysProp( "java.runtime.version" );
+    logSysProp( "java.home" );
+  }
+
   private static void configureLogging() {
     PropertyConfigurator.configure( System.getProperty( "log4j.configuration" ) );
 //    String fileName = config.getGatewayConfDir() + File.separator + "log4j.properties";


Mime
View raw message