Interesting challenge as these are not overrideable properites of the Task Definition.
However you can hijack the device to output somewhere else.
Here is an example dynamically adding a datetime suffix to the logfile for a built-in System Task.
So if you enable Logging to "c:\temp\T" (WIndows example) on this task and selected OutputFileSuffix property "
/// Seems to need %SYS.Task.Definition in super list to be
/// visible in Task Schedule Wizard
Class Test.SuperRunLegacyTask Extends (%SYS.Task.RunLegacyTask, %SYS.Task.Definition)
{
/// Example flexible property to enable selecting a given Date and Time format
/// from the Schedule Wizard, to use as Suffix appended to log file name (When in use)
Property OutputFileSuffix As %String(DISPLAYLIST = ",MM/DD/[YY]YY,DD Mmm [YY]YY,[YY]YY-MM-DD,DD/MM/[YY]YY", VALUELIST = ",1,2,3,4") [ InitialExpression = 3 ];
Method OnTask() As %Status
{
set current=$IO
set useDev=0
// Checks has at least 2 path seperators
// Checks not a null device
if $L($TR(current,"\/"))<($L(current)-1),$L(current,":")<2 {
set dev=current_$TR($ZDT($ZTS,..OutputFileSuffix),", :/()-","__")
Open dev:"NWS":2
if $T set useDev=1
}
if useDev {
use dev do {
set tSC=##super()
close dev
} while 0
} else {
set tSC=##super()
}
quit tSC
}
}- Log in to post comments