• Did you ever incorporate mail logs?

    By John Smart/RCS 2 decades ago

    Julian,



    Did you ever incorporate the modifications I had sent you a while back that enables the option to send logs via mail rather than access the OpenLog db directly? I did it so that we could centralize logging from agents that ran on users' sometimes-connected laptops.



    If not, would you like me to resend?

    • By Julian Robichaux 2 decades ago

      John -



      I think I still have it, but you'd better resend. I've got so many friggin versions of this database on my machine, it's hard to know which is which.



      Sorry I've been so silent on this project…Bruce has been bugging me to get a "1.0" release out too. I actually started looking around at the database again recently, so maybe I can kill two birds with one stone: incorporate your changes with the 1.0 release.



      Thanks.


      • Julian
      • Changes required (for LotusScript)

        By John Smart/RCS 2 decades ago

        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

  • By Julian Robichaux 2 decades ago

    John -



    Thanks for posting that. I think I'll also add a boolean that allows you to only send an e-mail or add to the log and send an e-mail both.



    I also have a couple small changes that I need to incorporate regarding calling functions from Actions and writing to the log if you've only got Depositor access. Maybe 1.0 will be soon…


    • Julian
  • Added as an example in 1.0

    By Julian Robichaux 2 decades ago

    I added a script library called MailLogSubclass that describes how to incorporate this functionality using a subclass of LogItem. Thanks again!