Merged PR 15380: Added logging for when a network error is encountered
Added logging for when a network error is encountered
This commit is contained in:
parent
8a44de0075
commit
e0b3557068
@ -34,6 +34,15 @@ Declare subroutine Shipment_Services, OBJ_Notes
|
||||
|
||||
Equ CRLF$ to \0D0A\
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\COC_Availability'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
LogTime = Oconv(Time(), 'MTS')
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : '_NETWORK.log'
|
||||
Headers = 'Logging DTM' : @FM : 'Message'
|
||||
ColumnWidths = 30 : @FM : 300
|
||||
objLogNetwork = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ' ', Headers, ColumnWidths, False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
GoToService
|
||||
|
||||
Return Response or ""
|
||||
@ -53,7 +62,7 @@ Options MonaResources = 'FILE_GENERATION', 'FILE_TRANSMISSION', 'FILE_AVAILABILI
|
||||
//
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service CycleRetentionDates()
|
||||
|
||||
|
||||
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
|
||||
Lock hSysLists, ServiceKeyID then
|
||||
CycleRec = Xlate('APP_INFO', 'COC_AVAILABILITY', '', 'X')
|
||||
@ -165,7 +174,11 @@ Service CheckFileAvailability(StartDate, EndDate)
|
||||
end
|
||||
// Code to run COC SELECT and change MONA Status
|
||||
If NetworkError EQ False$ then
|
||||
//Log that there were no network errors detected.
|
||||
NetworkLogMessage = 'No network errors detected.'
|
||||
GoSub LogNetworkStatus
|
||||
Shipment_Services('ClearMONACritical', 'FTP_SERVER_REACHABLE')
|
||||
|
||||
EarliestDate = Shipment_Services('GetEarliestDate')
|
||||
EarliestDate = OConv(EarliestDate, 'D4-')
|
||||
SelectQuery = 'SELECT COC BY ENTRY_DATE WITH ENTRY_DATE GE ' : Quote(EarliestDate) : ' AND WITH FTP_SHOULD_EXIST EQ 1 AND WITH FTP_EXISTS EQ 0'
|
||||
@ -185,6 +198,12 @@ Service CheckFileAvailability(StartDate, EndDate)
|
||||
Shipment_Services('ClearMONACritical', 'FILE_AVAILABILITY')
|
||||
end
|
||||
end else
|
||||
//Log that there were network errors detected.
|
||||
If Assigned(ErrTest) then
|
||||
NetworkLogMessage = ErrTest
|
||||
swap CRLF$ with ' , ' in NetworkLogMessage
|
||||
GoSub LogNetworkStatus
|
||||
end
|
||||
Shipment_Services('SetMONAWarning', 'FTP_SERVER_REACHABLE')
|
||||
Error_Services('Add', Service : 'service failed. ''An issue connecting to the FTP server has occured.')
|
||||
end
|
||||
@ -339,6 +358,33 @@ InitCocLog:
|
||||
|
||||
return
|
||||
|
||||
InitNetworkLog:
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\COC_Availability'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
LogTime = Oconv(Time(), 'MTS')
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : '_NETWORK.log'
|
||||
Headers = 'Logging DTM' : @FM : 'Message'
|
||||
ColumnWidths = 30 : @FM : 300
|
||||
objLogNetwork = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ' ', Headers, ColumnWidths, False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
return
|
||||
|
||||
LogNetworkStatus:
|
||||
|
||||
If Assigned(NetworkLogMessage) then
|
||||
ErrorLogMessage = NetworkLogMessage
|
||||
end else
|
||||
ErrorLogMessage = 'Unspecified network error'
|
||||
end
|
||||
GoSub InitNetworkLog
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDTM
|
||||
LogData<2> = ErrorLogMessage
|
||||
Logging_Services('AppendLog', objLogNetwork, LogData, @RM, @FM)
|
||||
|
||||
return
|
||||
|
||||
LogMissingFile:
|
||||
|
||||
@ -400,3 +446,4 @@ CompanyExceptionCheck:
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user