Index: trunk/ippTasks/detrend.stack.pro
===================================================================
--- trunk/ippTasks/detrend.stack.pro	(revision 17699)
+++ trunk/ippTasks/detrend.stack.pro	(revision 18048)
@@ -5,7 +5,4 @@
 # test for required global variables
 check.globals
-
-$LOGSUBDIR = $LOGDIR/detrend
-exec mkdir -p $LOGSUBDIR
 
 book init detPendingStackedImfile
@@ -53,5 +50,5 @@
 
   stdout NULL
-  stderr $LOGSUBDIR/detstack.log
+  stderr $LOGDIR/detrend.stack.load.log
 
   task.exec
@@ -125,17 +122,8 @@
     sprintf outroot "%s/%s.%s.%s/%s.%s.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $CAMERA $DET_TYPE $DET_ID $ITERATION
 
-    ## generate output log based on filerule (convert the URI to a PATH)
-    $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.stack.pro:141"
-      break
-    end
+    stdout $LOGDIR/detrend.stack.run.log
+    stderr $LOGDIR/detrend.stack.run.log
 
-    stdout $logfile
-    stderr $logfile
-    dirname $logfile -var outpath
-    mkdir $outpath
-
-    $run = detrend_stack.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA --outroot $outroot
+    $run = detrend_stack.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA --outroot $outroot --redirect-output
     if ("$REDUCTION" != "NULL")
       $run = $run --reduction $REDUCTION
