• Running a server agent manually from a local Notes client

    By Bruce Elgort/NotesOSS 2 decades ago

    Julian,



    First thanks for a great application. This type of logging system is an awesome tool that I will be using in my Notes/Domino development work. Secondly, I ran into a small thing that should be placed in the Using this Database document.



    I setup the OpenLog.nsf on my development server as described in the documentation. I then created a new agent in one of my existing databases and included the On Error Goto logError Call LogError code. I then ran the agent from my local workstation and it executed normally. I then checked the OpenLog.nsf db on the server and didn't see any log document. Note that my agent code forced an error to occur so I could test out your wares.



    I then opened a local "copy" and not a "replica"of the OpenLog.nsf and found a new document in the view. So now I learned that users should make a replica of the OpenLog.nsf db on any workstation they plan on using to test agents.



    Keep up the great work and I will pass on more feedback as it develops.



    Regards,



    Bruce

    • You are correct, sir

      By Julian Robichaux 2 decades ago

      Bruce -



      Thanks for pointing that out. You are correct that if you run an agent from your local workstation, that it will log (or attempt to log) to an OpenLog database locally, not on the server that the database resides on.



      However, that is by design. The OpenLog scripts are hardcoded to always write to a local copy of the log database. This is partially a performance consideration (because opening and writing to a database on a remote server is time consuming), and partially a security issue (if the agent was running as a background or scheduled agent on the server, it wouldn't even be able to access a remote server in R5, and on an ND6 server you would have to have the "trusted server" relationships set up properly).



      Of course, you can also use this to your advantage. Because the agents will log to your local database, you don't have to worry about new log items being created on the log database on the server as you're testing the agents from your workstation (this may be especially important if you have the notifications set up).



      One additional thing to keep in mind is that the log database on your local machine has to be in the same subdirectory (relative to the Notes data directory) as the log database on your server for the local logging to work properly. If not, then the logging will fail silently, which shouldn't affect the agent, but which will cause you to not get any log documents.



      Thanks again for testing. Please tell me if you notice anything else that seems wrong or counter-intuitive.


      • Julian
    • Functionality enhancement in release 0.92

      By Julian Robichaux 2 decades ago

      As of version 0.92 of the database, the logging functionality has been enhanced to provide greater flexibility on which database you'll be logging to.



      Agents or scripts that are being run on a server-based database from a local workstation will now attempt to log errors and events to the server that the database is on instead of the local workstation by default (because that's what people seemed to expect). You can also override or modify the logging behavior with much more granularity using the public boolean useServerLogWhenLocal and logToCurrentDatabase variables, and the UseCustomLogDb function/method


      • Julian