Index: /branches/rel10_ifa/psModules/src/config/pmConfig.c
===================================================================
--- /branches/rel10_ifa/psModules/src/config/pmConfig.c	(revision 6478)
+++ /branches/rel10_ifa/psModules/src/config/pmConfig.c	(revision 6479)
@@ -3,6 +3,6 @@
  *  @author PAP, IfA
  *
- *  @version $Revision: 1.7.4.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-02-17 17:13:41 $
+ *  @version $Revision: 1.7.4.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-02-24 04:02:19 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -11,4 +11,5 @@
 #include <stdio.h>
 #include <string.h>
+#include <unistd.h>
 #include "pslib.h"
 #include "pmConfig.h"
@@ -217,14 +218,20 @@
     psString logDest = psMetadataLookupStr(&mdok, *site, "LOGDEST");
     if (mdok && logDest) {
-        // XXX: Only stdout is provided for now; this section should be
+        // XXX: Only stdout and stderr are provided for now; this section should be
         // expanded in the future to do files, and perhaps even sockets.
-        if (strcasecmp(logDest, "STDOUT") != 0) {
-            psLogMsg(__func__, PS_LOG_WARN, "Only STDOUT is currently supported as a log destination.\n");
+        int logFD = STDIN_FILENO; // a known invalid value
+        if (!strcasecmp(logDest, "STDOUT")) {
+            logFD = STDOUT_FILENO;
+        }
+        if (!strcasecmp(logDest, "STDERR")) {
+            logFD = STDERR_FILENO;
+        }
+        if (logFD == STDIN_FILENO) {
+            psLogMsg(__func__, PS_LOG_WARN, "Only STDERR and STDOUT currently supported as a log destination.\n");
+            logFD = STDERR_FILENO;
         }
         psTrace(__func__, 7, "Setting log destination to STDOUT.\n");
-        // XXX: Use something other than "1"
-        psLogSetDestination(1);
-    }
-
+        psLogSetDestination(logFD);
+    }
 
     //
