You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ma...@apache.org on 2011/02/18 06:01:03 UTC

svn commit: r1071886 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java

Author: mamta
Date: Fri Feb 18 05:01:02 2011
New Revision: 1071886

URL: http://svn.apache.org/viewvc?rev=1071886&view=rev
Log:
Derby DERBY-4853 log derby.properties location and derby.log location to derby.log

With this change,we will log additional information in derby.log to make it easier for the support group to work with customer problems.

Following 2 additional properties will now always be put in derby.log (every time a database is booted) 
user.dir 
derby.system.home 

user.dir is the system property which gives the user working directory. 

If the user has not specified derby,system.home, then Derby will look for optional derby.properties file in user.dir . If user has provided derby.system.home, then the optional derby.properties will be looked in derby.system.home rather than user.dir 

If user has not provided derby.system.home, then a sample of the 2 properties on derby.log looks as follows on my machine 
user.dir=C:\p4clients\svnmain\client2\trunk\systest\out142 
derby.system.home=null 

If user has set derby.system.home to c:./temp, then a sample of the 2 properties on derby.log looks as follows on my machine 
user.dir=C:\p4clients\svnmain\client2\trunk\systest\out142 
derby.system.home=c:/temp 

In addition to the above 2 properties, there can be following 3 optional properties in the log (following the 2 properties mentioned above) 
derby.stream.error.file 
derby.stream.error.method 
derby.stream.error.field 

The above 3 properties provide a way to alter where error messages get logged rather than tranditional derby.log file. In the absence of the above 3 optional properties, the location of derby.log follows the same logic as derby.properties. But if the user has set any or all of the 3 optional properties, then derby.log will not be in same location as derby.properties. In the Derby code, derby.stream.error.file takes precedence over the other 2 properties and derby.stream.error.method take precedence over the last property. 



Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java?rev=1071886&r1=1071885&r2=1071886&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java Fri Feb 18 05:01:02 2011
@@ -370,6 +370,26 @@ public class BaseDataFileFactory
 		//Log the JVM version info
 		logMsg(jvmVersion);
 
+		//Log derby.system.home It will have null value if user didn't set it
+		logMsg(Property.SYSTEM_HOME_PROPERTY+"=" + 
+				PropertyUtil.getSystemProperty(Property.SYSTEM_HOME_PROPERTY));
+		
+		//Log properties related to redirection of derby.log 
+		String target = 
+			PropertyUtil.getSystemProperty(Property.ERRORLOG_FILE_PROPERTY);
+		if (target != null)
+			logMsg(Property.ERRORLOG_FILE_PROPERTY+"=" + target);
+		
+		target = 
+			PropertyUtil.getSystemProperty(Property.ERRORLOG_METHOD_PROPERTY);
+		if (target != null)
+			logMsg(Property.ERRORLOG_METHOD_PROPERTY+"=" + target);
+		
+		target = 
+			PropertyUtil.getSystemProperty(Property.ERRORLOG_FIELD_PROPERTY);
+		if (target != null)
+			logMsg(Property.ERRORLOG_FIELD_PROPERTY+"=" + target);
+
         if (logBootTrace)
            Monitor.logThrowable(new Throwable("boot trace"));
 		uf = null;
@@ -2203,6 +2223,8 @@ public class BaseDataFileFactory
                      jvmversion += "\njava.runtime.version=" + currentProp;
                  if ((currentProp = PropertyUtil.getSystemProperty("java.fullversion")) != null)
                      jvmversion += "\njava.fullversion=" + currentProp ;         
+                 if ((currentProp = PropertyUtil.getSystemProperty("user.dir")) != null)
+                     jvmversion += "\nuser.dir=" + currentProp ;         
               }
               catch (SecurityException se) {
                    return se.getMessage();