Here are the changes necessary for the OpenLogFunctions class to add functionality to mail log documents rather than save them to a database.
I only did it in LotusScript…
- somewhere in declarations, include…
'** Unless empty, logs are emailed to this address rather saved to a database.
Private logDefaultMailAddress As String
- in the list of properties of Class LogItem, add:
Public mailAddress As String ' empty if doc should be saved rather than mailed
- in LogItem.New, add
mailAddress = logDefaultMailAddress
- in LogItem.WriteToLog, change
Call logDoc.Save(True, False)<br/>
to
If Len(mailAddress) = 0 Then<br/>
Call logDoc.Save(True, False)<br/>
Else<br/>
Call logDoc.send(False, mailAddress)<br/>
End If<br/>
- Add the following function to the script library
Function UseMailLog(sMailAddress As String) As Integer 'boolean
'** Send all errors and events to the Database of your choice via mail, instead of<br/>
'** the default OpenLog database. After you've called this method once,<br/>
'** all further errors and events will be emailed to this database (so you don't <br/>
'** have to call it before every call to LogError or LogEvent).<br/>
On Error Goto processError<br/>
<br/>
Dim session As New NotesSession<br/>
Set logDb = session.currentDatabase<br/>
logDefaultMailAddress = sMailAddress<br/>
dbInitiated = True<br/>
UseMailLog = True<br/>
Exit Function<br/>
<br/>
processError:
DebugPrint(StandardErrorMessage(Err, Erl, Error$, Lsi_info(2)))<br/>
Resume Next<br/>
<br/>
End Function