Merged PR 28822: Added logging for de/re-archiving methods
Added logging for de/re-archiving methods
This commit is contained in:
parent
3d786a7916
commit
52b3b20b4e
File diff suppressed because it is too large
Load Diff
@ -43,8 +43,8 @@ $insert API_SETUP
|
|||||||
$insert HTTP_INSERTS
|
$insert HTTP_INSERTS
|
||||||
$Insert IFX_EQUATES
|
$Insert IFX_EQUATES
|
||||||
|
|
||||||
Declare subroutine Service_Services
|
Declare subroutine Service_Services, Logging_Services
|
||||||
Declare function OI_Wizard_Services
|
Declare function OI_Wizard_Services, Logging_Services, Environment_Services
|
||||||
|
|
||||||
GoToAPI else
|
GoToAPI else
|
||||||
// The specific resource endpoint doesn't have a API handler yet.
|
// The specific resource endpoint doesn't have a API handler yet.
|
||||||
@ -60,7 +60,15 @@ Return Response OR ''
|
|||||||
|
|
||||||
|
|
||||||
API dearchive.ID.POST
|
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 = ''
|
ErrorMsg = ''
|
||||||
OIWizardID = ''
|
OIWizardID = ''
|
||||||
Cookies = HTTP_Services('GetHTTPCookie')
|
Cookies = HTTP_Services('GetHTTPCookie')
|
||||||
@ -75,16 +83,36 @@ API dearchive.ID.POST
|
|||||||
|
|
||||||
If ValidSession then
|
If ValidSession then
|
||||||
ArchiveId = EndpointSegment
|
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
|
swap '__' with '*' in ArchiveId
|
||||||
If RowExists('ARCHIVE', ArchiveId) then
|
If RowExists('ARCHIVE', ArchiveId) then
|
||||||
Service_Services('PostProcedure', 'ARCHIVE_SERVICES', 'DeArchiveDataFromTxt':SD$:ArchiveId)
|
Service_Services('PostProcedure', 'ARCHIVE_SERVICES', 'DeArchiveDataFromTxt':SD$:ArchiveId)
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
Message = 'Successfully queued data for de-archive.'
|
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
|
end else
|
||||||
ErrorMsg = 'Error queueing de-archiving.'
|
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
|
||||||
end else
|
end else
|
||||||
ErrorMsg = 'Archive record not found in database.'
|
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
|
end
|
||||||
|
|
||||||
If ErrorMsg NE '' then
|
If ErrorMsg NE '' then
|
||||||
|
@ -43,8 +43,8 @@ $insert API_SETUP
|
|||||||
$insert HTTP_INSERTS
|
$insert HTTP_INSERTS
|
||||||
$Insert IFX_EQUATES
|
$Insert IFX_EQUATES
|
||||||
|
|
||||||
Declare subroutine Service_Services
|
Declare subroutine Service_Services, Logging_Services
|
||||||
Declare function OI_Wizard_Services
|
Declare function OI_Wizard_Services, Environment_Services, Logging_Services
|
||||||
|
|
||||||
GoToAPI else
|
GoToAPI else
|
||||||
// The specific resource endpoint doesn't have a API handler yet.
|
// The specific resource endpoint doesn't have a API handler yet.
|
||||||
@ -61,6 +61,14 @@ Return Response OR ''
|
|||||||
|
|
||||||
API rearchive.ID.POST
|
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 = ''
|
ErrorMsg = ''
|
||||||
OIWizardID = ''
|
OIWizardID = ''
|
||||||
Cookies = HTTP_Services('GetHTTPCookie')
|
Cookies = HTTP_Services('GetHTTPCookie')
|
||||||
@ -75,16 +83,36 @@ API rearchive.ID.POST
|
|||||||
|
|
||||||
If ValidSession then
|
If ValidSession then
|
||||||
ArchiveId = EndpointSegment
|
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
|
swap '__' with '*' in ArchiveId
|
||||||
If RowExists('ARCHIVE', ArchiveId) then
|
If RowExists('ARCHIVE', ArchiveId) then
|
||||||
Service_Services('PostProcedure', 'ARCHIVE_SERVICES', 'ReArchive':SD$:ArchiveId)
|
Service_Services('PostProcedure', 'ARCHIVE_SERVICES', 'ReArchive':SD$:ArchiveId)
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
Message = 'Successfully queued data for re-archive.'
|
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
|
end else
|
||||||
ErrorMsg = 'Error queueing re-archiving.'
|
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
|
||||||
end else
|
end else
|
||||||
ErrorMsg = 'Archive record not found in database.'
|
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
|
end
|
||||||
|
|
||||||
If ErrorMsg NE '' then
|
If ErrorMsg NE '' then
|
||||||
|
Reference in New Issue
Block a user