Hi Everyone,
We have a lot of agents running on our custom databases and they generate quite a big chunk from log.nsf lines on Domino servers.
We were wondering if there is a way to separate AMgr logs into another separate log file? Just to keep log.nsf cleaner and smaller. I could not find any info about that in documentation. Perhaps there is a notes.ini parameter for that, or a UI equivalent for that?
We still need to keep those AMgr logs, so disabling them is not an option.
Thank you
My first Question: Are these agent logs like "Agent starts..." "Agent ends..." or do your developers use "Print statements" to output Agent messages to the log?
If it is the first one, then you can only disable them (Log_AgentManager=0 in the notes.ini of the server) but not redirect them.
If it is the second one: Hit your developers hard and make them write their logs to a Database (e.g. Using the NotesLog- Class with its OpenFileLog method or any own logging mechanism (e.g. using OpenLog from OpenNtf). Printing agent logs to the console is an absolute NoGo... who is going to monitor them?
We have special logging in place that we use for every single agent we run.
Every agent can log its start, and end (if needed) and any message that might be of interest. Here are sample examples of the log view and the form that is used:
NotesLog is a really versatile object. Besides logging to the AgentLog (the log that has very limited space that is the log of the last run of the agent) by initializing with OpenAgentLog, it offers three other options:
OpenMailLog : log to a mail message, sent on close. All message are in 1 memo.
OpenFileLog : log to a file.
OpenNotesLog : log to a Notes datbase (based on alog4.ntf). Note that each LogAction or LogError will result in a new document. Not recommended for verbose logs.
Note that a file log resides on the machine executing the code. But since it is very simple, performance is excellent.
One use for OpenMailLog is to log to a logging database not writable for the user running the agent. And the text is in a rich text field (Body), so does not burden the view indexer like a NotesLog database. But you can still use a fulltext index to search the log!
Also, because of rich text used in OpenMailLog, the logs can be really big. What really helps is to wrap usage in a custom class, so you can easly handle special cases. Like messaging the Admin if a big log is created. Or breaking up the log if it grows too big. Or extra alerts are sent on logging certain errors. etc etc.
So there are many options available to avoid logging to the server log.nsf. Another big plus of redirecting those log messages is that by default, the server log is thrown away after 7 days. A big pain if you are looking for crucial messages created a month ago...
Creating your own standard logging facility also enables you to to run several logs at once. Really helpful when multiple roles are involved that all need diffferent kinds of information. So not every qeury results in sifting through the server log...
Hi Andrei,
I agree 100% with the previous suggestions on using the agent log. However as I am not sure the actual output you are seeing in your console.log but its possible that there may be some agent manager debug enabled that is writing to the console.log. If its not actively being used to debug an issue, you can disable it. Just go to a server console and issue the command
tell amgr debug off