Trace logs - to be able to enable or disable it with a setting

Jun 3, 2015 at 10:18 AM
Hello,

It would be great to add a setting (code based or in app.config) allowing us to specify if we wan't or not to activate "trace". For instance a parameter named "IsTraceOn" or "IsDebugOn".

The aim is to have in the XecMe code :
  if( isTraceOn ) Trace.[...]
... instead of the actual
  Trace.[...]
Why ? Because when having multiple TimerTask executing very frequently then this will cause sometimes a lot of unused log traces. Let the dev choose with an option to enable or disable it could be a good idea.
Coordinator
Jun 3, 2015 at 11:11 PM
Hi Guico,

I will add traceFilter attribute to Task declaration in App.config such that you can enable, disable or chose certain type of trace at the output. This will be an optional attribute defaulted to allow all (current default behavior).
<timerTaskRunner name="Queue monitor" 
                  taskType="Fully Qualified Type Name of ITask implementation should go here" 
                  interval="time between the triggers" 
                  startDateTime="Start date time for this task" 
                  endDateTime="End date time for this task" 
                  dayStartTime="Start time of the day" 
                  dayEndTime="End time of the day" 
                  recurrence="number of time" 
                  timeZone="time zone id string - task will be triggered for this time zone"
                  traceFilter="All">
  <!-- Parameters serve as input parameters to the task-->
  <parameters>
    <parameter name="test1" value="val1"/>
    <parameter name="test2" value="val2"/>
    <parameter name="test3" value="val3"/>
  </parameters>
</timerTaskRunner>
The possible traceFilter values will be

None - Disables trace on that task
Error - Allows error type of traces to output
Warning - Allows warning type of traces to output
Information - Allows information type of traces to output
All (Default) - Allows all type of traces to output

You can use one or more combinations like _traceFilter="Error,Warning"

Thanks
Shailesh
Coordinator
Jun 3, 2015 at 11:12 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Jun 4, 2015 at 7:57 AM
Edited Jun 4, 2015 at 8:23 AM
Hello Shailesh, That's perfect. Thanks.
Coordinator
Jun 9, 2015 at 6:49 PM
Hi Guico,

I have updated the code still to create the NuGet package. In the meanwhile you may want to pull the source code to test it.
Jun 10, 2015 at 9:22 AM
Hi, thanks !