Skip to content

Log File Creation With Wildcards

The following wildcards/format-names can be used in the path for your logfiles as defined in a consumer or provider program. MDRest4i will then replace these with the appropriate value as described below.

Warning

This naming substitution only applies to IFS logs, not the DATAQ and PF options available in MDRSTCFG

Sub-folder creation

If the last directory in the path (immediately before the file name -- 2024-10-01 in the example below) doesn’t exist it will created automatically before the log is added to it. This can be used with hardoced values AND replacement wildcards.

Examples:

MDR_setClientOpt(handle: MDR_LOG_PATH: 'ifs:/logs/%F/APICNS-%E.TXT');

Creates log file:

/logs/2024-10-03/APICNS-2024-10-03-08.29.46.469000000000.TXT (creating directory "2024-10-03" in the process)

MDR_setClientOpt(handle: MDR_LOG_PATH: 'ifs:/logs/createme/APICNS-%E.TXT');

Creates log file:

/logs/createme/APICNS-2024-10-03-08.29.46.469000000000.TXT (creating directory "createme" in the process)

Format Description
%a Abbreviated weekday name
%A Full weekday name
%b Abbreviated month name
%B Full month name
%C Century number [00-99], the year divided by 100 and truncated to an integer
%d Day of the month [01-31]
%F ISO Date Format, same as %Y-%m-%d
%E Adds a unique timestamp such as 2024-10-01-08.45.22.134660000001
%H Hour in 24-hour format [00-23]
%I Hour in 12-hour format [01-12]
%j Day of the year [001-366]
%m Month [01-12]
%M Minute [00-59]
%p AM or PM string
%R 24-hour time format without seconds, same as %H:%M
%S Second [00-61]. The range for seconds allows for a leap second and a double leap second
%T 24-hour time format with seconds, same as %H:%M:%S
%u Weekday [1,7]. Monday is 1 and Sunday is 7
%U Week number of the year [00-53]. Sunday is the first day of the week
%w Weekday [0,6], Sunday is 0
%W Week number of the year [00-53]. Monday is the first day of the week
%y 2 digit year [00,99]
%Y 4-digit year. Can be negative
%z UTC offset. Output is a string with format +HHMM/-HHMM where:
+ indicates east of GMT,
- indicates west of GMT,
HH indicates the number of hours from GMT,
MM indicates the number of minutes from GMT
%Z Time zone name
%% % character