Log file

Jochen Katz katz____agentpp.com
Thu May 30 20:53:31 CEST 2002


Hi,

 > I have a couple of questions about the file logging that is provided
 > in the agent++.  First of all, is there a way to restrict how big
 > the file gets?  Some of the files have gotten so big that we can't
 > even open them without the system crashing.  Is there a some sort of
 > setting provided through the agent++ or snmp++ to make the file
 > cyclic?

there is a method that can be used to implement such a thing. After the 
following calls, agent++ will log to the new file (you will have to 
close the old file afterwards):

DefaultLog::log->lock();
DefaultLog::log->set_dest(FILE* )
DefaultLog::log->unlock();

 > Second, there is a set_filter method in the log.h.  What should I
 > set the filter to if I only want warnings or errors to show up in
 > the log file?

You will have to set them to 0:

DefaultLog::log->set_filter(ERROR_LOG, i);
DefaultLog::log->set_filter(WARNING_LOG, j);
DefaultLog::log->set_filter(EVENT_LOG, 0);
DefaultLog::log->set_filter(INFO_LOG, 0);
DefaultLog::log->set_filter(DEBUG_LOG, 0);

Kind regards,
   Jochen





More information about the AGENTPP mailing list