updates, resin support
[org.ibex.jinetd.git] / src / org / ibex / jinetd / Main.java
index a939720..7e3b08d 100644 (file)
@@ -22,8 +22,8 @@ public class Main {
     }
 
     public static String ROOT;
-    public static String LOGFILE;
-    public static PrintStream LOGSTREAM;
+    private static String LOGFILE;
+    private static PrintStream LOGSTREAM;
     public static String defaultDomain;
 
     public static void init() {
@@ -38,12 +38,14 @@ public class Main {
                 defaultDomain = localMachine.getHostName();
             } catch(java.net.UnknownHostException uhe) { defaultDomain = "localhost"; }
             System.err.println("    jinetd.hostname = " + defaultDomain);
-            LOGFILE = System.getProperty("jinetd.logfile", ROOT + File.separatorChar+"log.txt");
-            System.err.println("    jinetd.logfile = " + LOGFILE);
-            System.err.println("    redirecting stdout/stderr to logfile." + LOGFILE);
-            LOGSTREAM = new PrintStream(new FileOutputStream(LOGFILE, true));
-            System.setErr(LOGSTREAM);
-            System.setOut(LOGSTREAM);
+            LOGFILE = System.getProperty("jinetd.logfile", /*ROOT + File.separatorChar+"log.txt"*/null);
+            if (LOGFILE != null) {
+                System.err.println("    jinetd.logfile = " + LOGFILE);
+                System.err.println("    redirecting stdout/stderr to logfile." + LOGFILE);
+                LOGSTREAM = new PrintStream(new FileOutputStream(LOGFILE, true));
+                System.setErr(LOGSTREAM);
+                System.setOut(LOGSTREAM);
+            }
 
             gatherDependencies();
         } catch (Throwable e) {