Index: trunk/psModules/src/config/pmConfig.c
===================================================================
--- trunk/psModules/src/config/pmConfig.c	(revision 7528)
+++ trunk/psModules/src/config/pmConfig.c	(revision 7576)
@@ -3,6 +3,6 @@
  *  @author PAP, IfA
  *
- *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-06-13 02:39:27 $
+ *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-15 02:24:19 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -258,6 +258,6 @@
                      "-camera command-line switch provided without the required filename --- ignored.\n");
         } else {
+            readConfig(&config->camera, argv[argNum], "camera");
             psArgumentRemove(argNum, argc, argv);
-            readConfig(&config->camera, argv[argNum], "camera");
         }
     }
@@ -310,27 +310,30 @@
 
 
-    //
-    // If LOGDEST is specified in the configuration file, then we must initialize
-    // with a call to psLogSetDestination().
-    // XXX: This is not spec'ed in the SDRS.
-    //
-    psString logDest = psMetadataLookupStr(&mdok, config->site, "LOGDEST");
-    if (mdok && logDest) {
-        // XXX: Only stdout and stderr are provided for now; this section should be
-        // expanded in the future to do files, and perhaps even sockets.
-        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");
-        psLogSetDestination(logFD);
+    argNum = psArgumentGet(*argc, argv, "-log");
+    if (argNum > 0) {
+        psArgumentRemove(argNum, argc, argv);
+        if (argNum >= *argc) {
+            psLogMsg(__func__, PS_LOG_WARN,
+                     "-log command-line switch provided without the required log destination --- ignored.\n");
+        } else {
+            if (!psLogSetDestination(psMessageDestination(argv[argNum]))) {
+                psLogMsg(__func__, PS_LOG_WARN, "Unable to set log destination to %s\n", argv[argNum]);
+            }
+            psArgumentRemove(argNum, argc, argv);
+        }
+    } else {
+        //
+        // If LOGDEST is specified in the configuration file, then we must initialize
+        // with a call to psLogSetDestination().
+        // XXX: This is not spec'ed in the SDRS.
+        //
+        psString logDest = psMetadataLookupStr(&mdok, config->site, "LOGDEST");
+        if (mdok && logDest && strlen(logDest) > 0) {
+            // 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 (!!psLogSetDestination(psMessageDestination(argv[argNum]))) {
+                psLogMsg(__func__, PS_LOG_WARN, "Unable to set log destination to %s\n", argv[argNum]);
+            }
+        }
     }
 
