Index: trunk/ippTasks/detrend.correct.pro
===================================================================
--- trunk/ippTasks/detrend.correct.pro	(revision 17699)
+++ trunk/ippTasks/detrend.correct.pro	(revision 18048)
@@ -5,7 +5,4 @@
 # test for required global variables
 check.globals
-
-$LOGSUBDIR = $LOGDIR/detrend
-exec mkdir -p $LOGSUBDIR
 
 book init detPendingCorrectedImfile
@@ -71,5 +68,5 @@
 
   stdout NULL
-  stderr $LOGSUBDIR/detcorr.imfile.log
+  stderr $LOGDIR/detcorr.load.log
 
   task.exec
@@ -146,18 +143,8 @@
     sprintf outroot "%s/%s.%s.%s/%s/%s.detcorr.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $EXP_TAG $EXP_TAG $DET_ID
 
-    $logfile = `ipp_filename.pl --touch --filerule LOG.IMFILE --camera $CAMERA --class_id $CLASS_ID --basename $outroot`
-    if ("$logfile" == "") 
-      echo "WARNING: logfile not defined in detrend.correct.pro:150"
-      break
-    end
-
-    stdout $logfile
-    stderr $logfile
-    dirname $logfile -var outpath
-
-    # XXX I need to report the error if this fails...
-    mkdir $outpath
-
-    $run = detrend_correct_imfile.pl --det_id $DET_ID --exp_id $EXP_ID --class_id $CLASS_ID --exp_tag $EXP_TAG --input_uri $URI --corr_id $CORR_ID --corr_type $CORR_TYPE --camera $CAMERA
+    stdout $LOGDIR/detcorr.run.log
+    stderr $LOGDIR/detcorr.run.log
+
+    $run = detrend_correct_imfile.pl --det_id $DET_ID --exp_id $EXP_ID --class_id $CLASS_ID --exp_tag $EXP_TAG --input_uri $URI --corr_id $CORR_ID --corr_type $CORR_TYPE --camera $CAMERA --outroot $outroot --redirect-output
     if ("$WORKDIR" != "NULL")
       $run = $run --workdir $WORKDIR
@@ -202,5 +189,5 @@
 
   stdout NULL
-  stderr $LOGSUBDIR/detcorr.exp.log
+  stderr $LOGDIR/detcorr.exp.load.log
 
   task.exec
@@ -275,16 +262,9 @@
     sprintf outroot "%s/%s.%s.%s/%s/%s.detcorr.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $EXP_TAG $EXP_TAG $DET_ID
 
-    ## generate output log based on filerule (convert the URI to a PATH)
-    $logfile = `ipp_filename.pl --touch --filerule LOG.EXP --camera $CAMERA --class_id NONE --basename $outroot`
-    if ("$logfile" == "") 
-      $logfile = $outroot.log
-    end
-
-    stdout $logfile
-    stderr $logfile
-    dirname $logfile -var outpath
-    mkdir $outpath
-
-    $run = detrend_correct_exp.pl --det_id $DET_ID --exp_id $EXP_ID --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA --corr_id $CORR_ID --corr_type $CORR_TYPE --camera $CAMERA
+    stdout $LOGDIR/detcorr.exp.run.log
+    stderr $LOGDIR/detcorr.exp.run.log
+
+    $run = detrend_correct_exp.pl --det_id $DET_ID --exp_id $EXP_ID --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA --corr_id $CORR_ID --corr_type $CORR_TYPE --camera $CAMERA --redirect-output
+
     if ("$WORKDIR" != "NULL")
       $run = $run --workdir $WORKDIR
