Merged PR 28822: Added logging for de/re-archiving methods

Added logging for de/re-archiving methods
This commit is contained in:
Ouellette Jonathan (CSC FI SPS MESLEO)
2025-10-20 18:25:05 +00:00
parent 3d786a7916
commit 52b3b20b4e
3 changed files with 1452 additions and 1340 deletions

File diff suppressed because it is too large Load Diff

View File

@ -43,8 +43,8 @@ $insert API_SETUP
$insert HTTP_INSERTS
$Insert IFX_EQUATES
Declare subroutine Service_Services
Declare function OI_Wizard_Services
Declare subroutine Service_Services, Logging_Services
Declare function OI_Wizard_Services, Logging_Services, Environment_Services
GoToAPI else
// The specific resource endpoint doesn't have a API handler yet.
@ -60,7 +60,15 @@ Return Response OR ''
API dearchive.ID.POST
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Archive\DeArchiving'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' ArchiveService.csv'
Headers = 'Logging DTM' : @FM : 'Message'
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime
ErrorMsg = ''
OIWizardID = ''
Cookies = HTTP_Services('GetHTTPCookie')
@ -75,16 +83,36 @@ API dearchive.ID.POST
If ValidSession then
ArchiveId = EndpointSegment
LogData = ''
LogData<1> = LoggingDTM;
LogData<2> = ArchiveId
LogData<3> = 'Attempting to add de-archival to the process queue.'
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
swap '__' with '*' in ArchiveId
If RowExists('ARCHIVE', ArchiveId) then
Service_Services('PostProcedure', 'ARCHIVE_SERVICES', 'DeArchiveDataFromTxt':SD$:ArchiveId)
If Error_Services('NoError') then
Message = 'Successfully queued data for de-archive.'
LogData = ''
LogData<1> = LoggingDTM;
LogData<2> = ArchiveId
LogData<3> = Message
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
end else
ErrorMsg = 'Error queueing de-archiving.'
LogData = ''
LogData<1> = LoggingDTM;
LogData<2> = ArchiveId
LogData<3> = ErrorMsg
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
end
end else
ErrorMsg = 'Archive record not found in database.'
LogData = ''
LogData<1> = LoggingDTM;
LogData<2> = ArchiveId
LogData<3> = ErrorMsg
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
end
If ErrorMsg NE '' then

View File

@ -43,8 +43,8 @@ $insert API_SETUP
$insert HTTP_INSERTS
$Insert IFX_EQUATES
Declare subroutine Service_Services
Declare function OI_Wizard_Services
Declare subroutine Service_Services, Logging_Services
Declare function OI_Wizard_Services, Environment_Services, Logging_Services
GoToAPI else
// The specific resource endpoint doesn't have a API handler yet.
@ -61,6 +61,14 @@ Return Response OR ''
API rearchive.ID.POST
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Archive\ReArchiving'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' ArchiveService.csv'
Headers = 'Logging DTM' : @FM : 'Message'
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime
ErrorMsg = ''
OIWizardID = ''
Cookies = HTTP_Services('GetHTTPCookie')
@ -75,16 +83,36 @@ API rearchive.ID.POST
If ValidSession then
ArchiveId = EndpointSegment
LogData = ''
LogData<1> = LoggingDTM;
LogData<2> = ArchiveId
LogData<3> = 'Attempting to add re-archival to the process queue.'
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
swap '__' with '*' in ArchiveId
If RowExists('ARCHIVE', ArchiveId) then
Service_Services('PostProcedure', 'ARCHIVE_SERVICES', 'ReArchive':SD$:ArchiveId)
If Error_Services('NoError') then
Message = 'Successfully queued data for re-archive.'
LogData = ''
LogData<1> = LoggingDTM;
LogData<2> = ArchiveId
LogData<3> = Message
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
end else
ErrorMsg = 'Error queueing re-archiving.'
LogData = ''
LogData<1> = LoggingDTM;
LogData<2> = ArchiveId
LogData<3> = ErrorMsg
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
end
end else
ErrorMsg = 'Archive record not found in database.'
LogData = ''
LogData<1> = LoggingDTM;
LogData<2> = ArchiveId
LogData<3> = ErrorMsg
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
end
If ErrorMsg NE '' then