?
Solved

Open Agent Log using LotusScript

Posted on 2003-02-27
6
Medium Priority
?
1,051 Views
Last Modified: 2013-12-18
I have run a specific agent in the following code:

Set theAgent = db.GetAgent(Cstr(agent.Name))
Call theAgent.Run

At the same time, I want to open the Agent Log after the Agent run. But, it cannot open the Agent Log and error message cannot occur. How can I do that?

0
Comment
Question by:KenyonKen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 7

Expert Comment

by:scottrma
ID: 8035369
In your agent, you need to create a NotesLog class object and then log to it as follows:

Syntax
Dim variableName As New NotesLog(programName$)
or
Set notesLog = New NotesLog(programName$)

Parameter
programName$
String. A name that identifies the log.

Usage
Once you create a log using New, use the OpenAgentLog method to open the log before writing to it. You must explicitly log each action and error using the following methods:
To log an action, use LogAction.
To log an error, use LogError.
Notes does not automatically log actions or errors for you.

Regards,

Scott
0
 

Author Comment

by:KenyonKen
ID: 8039314
Thanks....Scott

I can implement the Agent Log now, but I need to do more is that I want to open the Agent Log just like when I test the Agent in Notes Designer. The report pop up after the agent run. Can I do this?

Cheers,
Kenyon
0
 
LVL 7

Expert Comment

by:scottrma
ID: 8043930
I don't think you can do this. I checked all the methods and properties in the NotesLog and NotesAgent class, and I don't see where you can do this. The little dialog window you are talking about only seems to come up when the agent is invoked from Domino Designer. You can use the following code to write to the agent log:

     Dim agentLog As New NotesLog("Agent log")
     Call agentLog.OpenAgentLog
     Call agentLog.LogAction("Action one")
     Call agentLog.Close

but there is no code available to make the little window pop up if the agent was not called to run from within Domino Designer, nor is there any code to programmatically read from the agent log, only to write to it.

Sorry, I have checked everywhere, so unless I am missing something (other experts will tell you immediately if this is the case), I don't think you can do what you are asking.

Regards,

Scott
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:KenyonKen
ID: 8045723
Hi Scott,

I also find all the meothods to provide that agent log, but still not find. So, I can only use :

"Call currentLog.OpenFileLog( "c:\log.txt" )"

to output the agent log instead. Do you have any more suggestions?

Cheers,
From Kenyon
0
 
LVL 7

Accepted Solution

by:
scottrma earned 120 total points
ID: 8045867
Well, yes, if you use OpenFileLog, then you will have the logging contents as a file on disk, and you could subsequently access that file, either manually or programmatically.

The only other way would be to code the logging mechanism yourself. That would basically involve creating a database with a form and fields and views to hold your log data and then in your agent you simply create log documents in this database. The Agent Log you are referring to doesn't really give out that much information anyway, just things like agent start time, number of documents the agent found to run on, agent end time. So it would be fairly easy to code this yourself. Example: use the Now() function at the beginning and end of your script to get the agent start and end times, and use session.CurrentDatabase.UnprocessedDocuments.Count property to get the number of documents the agent found to run on. Then just write this info to your custom log database.

Regards,

Scott
0
 

Author Comment

by:KenyonKen
ID: 8046290
Thanks o lot, Scoot.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question