Index: trunk/ippTasks/chip.pro
===================================================================
--- trunk/ippTasks/chip.pro	(revision 14094)
+++ trunk/ippTasks/chip.pro	(revision 14095)
@@ -119,4 +119,5 @@
     book getword chipPendingImfile $pageName camera -var CAMERA
     book getword chipPendingImfile $pageName exp_id -var EXP_ID
+    book getword chipPendingImfile $pageName exp_tag -var EXP_TAG
     book getword chipPendingImfile $pageName chip_id -var CHIP_ID
     book getword chipPendingImfile $pageName workdir -var WORKDIR
@@ -136,15 +137,20 @@
     ## generate output log based on filerule
     if ("$WORKDIR" == "NULL")
-      $outroot = `pwd`
+      $outpath = `pwd`
     else
-      $outroot = `ipp_datapath.pl $WORKDIR`
+      $outpath = `ipp_datapath.pl $WORKDIR`
     end
-    $outroot = $outroot/$EXP_ID
-    $logfile = $outroot/chip.$CLASS_ID.log
+    $outpath = $outpath/$EXP_TAG
+    $outroot = $outpath/$EXP_TAG.ch.$CHIP_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 = chip_imfile.pl --exp_id $EXP_ID --chip_id $CHIP_ID --class_id $CLASS_ID --input_uri $URI --camera $CAMERA
+    $run = chip_imfile.pl --exp_id $EXP_ID --chip_id $CHIP_ID --class_id $CLASS_ID --exp_tag $EXP_TAG --input_uri $URI --camera $CAMERA
     if ("$WORKDIR" != "NULL")
       $run = $run --workdir $WORKDIR
