Index: vhLib/Logging.cls.xml =================================================================== diff -u -r3366 -r3883 --- vhLib/Logging.cls.xml (.../Logging.cls.xml) (revision 3366) +++ vhLib/Logging.cls.xml (.../Logging.cls.xml) (revision 3883) @@ -36,6 +36,17 @@ %Time + +%String +1 + Set {*}= $ZDT( {datum}_","_{tijd},3,7 ) +1 + + + +%BigInt + + "E" = error @@ -209,6 +220,10 @@ CspSessionId + +SequenceId + + 1 objectgenerator @@ -229,16 +244,21 @@ Do ##class(TECH.Exceptions.GekendeExceptieMatcher).%New().KoppelErrorLog( oLog ) Set SendMail = (SendMail && oLog.TeBehandelen) } Catch { - #dim Exception As TECH.Exceptions.Exception = ##class(TECH.ExceptionHandler).Catch() - Do ##class(vhLib.Logger).%New().LogEnMailExceptie(Exception) + Try { + #dim Exception As TECH.Exceptions.Exception = ##class(TECH.ExceptionHandler).Catch() + Do ##class(vhLib.Logger).%New().LogEnMailExceptie(Exception) + } Catch {} } // Het log-item saven, is belangrijker dan de eventuele koppel-exceptie te behandelen. #dim scSave As %Status = oLog.%Save() - Set oLog.Detail = "Maak een nieuwe gekende exceptie"_$$$CRLF _ ..GeefMaakGekendeExceptieUrl(oLog) _ $$$CRLF_ $$$CRLF _ oLog.Detail + + Try { + Set oLog.Detail = "Maak een nieuwe gekende exceptie"_$$$CRLF _ ..GeefMaakGekendeExceptieUrl(oLog) _ $$$CRLF_ $$$CRLF _ oLog.Detail + } Catch {} // Geen error handling hier, om niet in een eindeloze recursie te belanden. #dim ServerPrefix As %String = "["_$$$UCase($$$Server)_"] " #dim Subject As %String = ServerPrefix _ $S(Niveau="I":"Info",Niveau="E":"Error",Niveau="W":"Warning",Niveau="D":"Debug",1:"")_" - " - Set Subject = Subject _ oLog.Groep_" : "_ Actie _ " - " _ $ZDT($H,4) + Set Subject = Subject _ oLog.Groep_" : "_ Actie _ " - SessionID: " _ oLog.SessionID _ " - " _ $ZDT($H,4) ; voortijdige quit indien een fout bij het opslaan van de log @@ -247,13 +267,14 @@ If ( scSave ) && ( SendMail ) & ( Niveau '= "D" ){ #dim Body As %GlobalCharacterStream = ##class(%GlobalCharacterStream).%New() Do Body.WriteLine($$GetJobInfo^vhLib.System()) + Do Body.WriteLine("SessionID: " _ oLog.SessionID) Do Body.WriteLine("") ;Do Body.CopyFrom(oLog.GenMailBody()) Do Body.WriteLine(oLog.Detail) Do oLogger.GetMailFields(.From,.lbTo,.Subject,) Do SendMiniMailForced^vhLib.Mail(From,lbTo,Subject,Body,1,,,,) } - + If Niveau="D" Do oLog.DebugWindow() Quit oLog @@ -293,20 +314,15 @@ set ..GebruikerID = ##class(TECH.Context.RuntimeContext).Instance().GeefGebruikerID() set ..Gebruiker = ##class(TECH.Context.RuntimeContext).Instance().GeefGebruikerInitialen() set ..SessionID = ##class(TECH.Context.RuntimeContext).Instance().GeefSessieID() - If ..SessionID '= "" { - Try { - Set ..ClientAdres = ##class(APPS.algemeen.VhintraShell.SessionService).%New().GeefClientAdresVoorSessieSleutel(..SessionID) - } Catch { - #dim Exception As TECH.Exceptions.Exception = ##class(TECH.ExceptionHandler).Catch() - } - } + Set ..SequenceId = $Increment(^vhLib.LoggingSequence) + - if $IsObject(Detail) { - set ..DetailAsStream = Detail - set ..Detail = Detail.Read(10000) + if $IsObject(Detail) { + Do ..DetailAsStream.CopyFrom(Detail) + Do Detail.Rewind() + set ..Detail = Detail.Read(10000) // Dubbel.. do Detail.Rewind() - } - else { + } else { Set ..Detail = Detail do ..DetailAsStream.WriteLine(Detail) } @@ -321,6 +337,39 @@ ]]> + + +Deze method mag geen ConfigMgr-acties oproepen. +1 +Groep:%String,Niveau:vhLib.enu.LogNiveau,Actie:%String,Detail:%String + + + 1 blnMultiLine:%String,Indent:%String @@ -366,6 +415,24 @@ ]]> + +insert:%Boolean +1 +%Status + + + + +1 +oid:%ObjectIdentity +%Status + + + %Library.CacheStorage ^LOG.vhLib.LoggingD @@ -443,6 +510,9 @@ CspSessionId + +SequenceId +