Hi,I would like to update the Log.nsf with some specified text while saving a document using script. For this I wrote the code as follows.
On QuerySave Event
Dim currentLog As NotesLog
Set currentLog = New NotesLog(“SDB system Log”)
Call currentLog.OpenNotesLog( Server, “log.nsf” )
Call currentLog.LogAction( “Document edited by Kishore” )
Call currentLog.Close
Please correct me If I am doing wrong…
Thanks,
Kishore
Subject: How can I update the log.nsf?
Here is a very good link where you can update your log.nsf from UI like button click
http://www.notes411.com/dominosource/tips.nsf/0/B39FEC1B5D793CB88025719A0043FF57!opendocument
It uses C API and is compatible for both Windows and UNIX.
I tested it on Windows.
Subject: How can I update the log.nsf?
The NotesLog class uses a database based on the agent log template (alog.ntf), not the server log database (log.nsf). If this is code that runs on the server (a scheduled agent, a WebQuery agent, etc.) then you can write to log.nsf using the Messagebox statement, but QuerySave happens in the client, not on the server. If you want to log errors and actions, create an agent log database from the alog.ntf template.