Index: /trunk/ippScripts/scripts/detrend_process_exp.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_process_exp.pl	(revision 13679)
+++ /trunk/ippScripts/scripts/detrend_process_exp.pl	(revision 13680)
@@ -149,5 +149,5 @@
 # Output files
 $workdir = caturi( $workdir, "$camera.$det_type.$det_id" ) if defined $workdir;
-my $outputRoot = $ipprc->file_prepare( "$exp_tag.detproc.$det_id", $workdir, ${$files}[0]->{path_base} );
+my $outputRoot = $ipprc->file_prepare( "$exp_tag/$exp_tag.detproc.$det_id", $workdir, ${$files}[0]->{path_base} );
 my $jpeg1 = $ipprc->filename("PPIMAGE.JPEG1", $outputRoot); # Binned JPEG #1
 my $jpeg2 = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2
Index: /trunk/ippScripts/scripts/detrend_process_imfile.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_process_imfile.pl	(revision 13679)
+++ /trunk/ippScripts/scripts/detrend_process_imfile.pl	(revision 13680)
@@ -89,5 +89,5 @@
 $workdir = caturi( $workdir, "$camera.$det_type.$det_id" ) if defined $workdir;
 
-my $outputRoot = $ipprc->file_prepare( "$exp_tag.detproc.$det_id", $workdir, $input_uri );
+my $outputRoot = $ipprc->file_prepare( "$exp_tag/$exp_tag.detproc.$det_id", $workdir, $input_uri );
 my $outputImage = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id);
 my $outputBin1 = $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $class_id);
@@ -150,5 +150,5 @@
     my $exit_code = shift; # Exit code to add
 
-    warn($msg);
+    carp($msg);
     if ($det_id and $exp_tag and $class_id and not $no_update) {
 	my $command = "$dettool -addprocessedimfile -det_id $det_id -exp_tag $exp_tag -class_id $class_id -code $exit_code";
Index: /trunk/ippTasks/detrend.process.pro
===================================================================
--- /trunk/ippTasks/detrend.process.pro	(revision 13679)
+++ /trunk/ippTasks/detrend.process.pro	(revision 13680)
@@ -154,13 +154,18 @@
     ## output log filename
     if ("$WORKDIR" == "NULL")
-      $outroot = `pwd`
-    else
-      $outroot = `ipp_datapath.pl $WORKDIR`
-    end
-    $outroot = $outroot/$CAMERA.$DET_TYPE.$DET_ID/$EXP_TAG
-    $logfile = $outroot/detproc.$DET_ID.$CLASS_ID.log
+      $outpath = `pwd`
+    else
+      $outpath = `ipp_datapath.pl $WORKDIR`
+    end
+    $outpath = $outpath/$CAMERA.$DET_TYPE.$DET_ID/$EXP_TAG
+    $outroot = $outpath/$EXP_TAG.detproc.$DET_ID
+    $logfile = `ipp_filename.pl --filerule LOG.IMFILE --camera $CAMERA --class_id $CLASS_ID --basename $outroot`
+    if ($logfile == "") 
+      $logfile = $outroot.$CLASS_ID.log
+    end
+
     stdout $logfile
     stderr $logfile
-    exec mkdir -p $outroot
+    exec mkdir -p $outpath
 
     $run = detrend_process_imfile.pl --det_id $DET_ID --det_type $DET_TYPE --exp_tag $EXP_TAG --class_id $CLASS_ID --input_uri $URI --camera $CAMERA
@@ -276,13 +281,18 @@
     # XXX push this into the filerules?
     if ("$WORKDIR" == "NULL")
-      $outroot = `pwd`
-    else
-      $outroot = `ipp_datapath.pl $WORKDIR`
-    end
-    $outroot = $outroot/$CAMERA.$DET_TYPE.$DET_ID/$EXP_TAG
-    $logfile = $outroot/detproc.$DET_ID.$ITERATION.log
+      $outpath = `pwd`
+    else
+      $outpath = `ipp_datapath.pl $WORKDIR`
+    end
+    $outpath = $outpath/$CAMERA.$DET_TYPE.$DET_ID/$EXP_TAG
+    $outroot = $outpath/$EXP_TAG.detproc.$DET_ID.$ITERATION
+    $logfile = `ipp_filename.pl --filerule LOG.EXP --camera $CAMERA --class_id NONE --basename $outroot`
+    if ($logfile == "") 
+      $logfile = $outroot.log
+    end
+
     stdout $logfile
     stderr $logfile
-    exec mkdir -p $outroot
+    exec mkdir -p $outpath
 
     $run = detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA
Index: /trunk/ippconfig/isp/camera.config
===================================================================
--- /trunk/ippconfig/isp/camera.config	(revision 13679)
+++ /trunk/ippconfig/isp/camera.config	(revision 13680)
@@ -140,4 +140,7 @@
 
    PPSIM.OUTPUT          OUTPUT {OUTPUT}.fits         IMAGE     FPA        TRUE      NONE
+
+   LOG.IMFILE            OUTPUT {OUTPUT}.{CHIP.NAME}.log TEXT   CHIP       TRUE      NONE
+   LOG.EXP               OUTPUT {OUTPUT}.log          TEXT      FPA        TRUE      NONE
 END
 
