[AGENT++] LOGGING mechanism for AGENT++,snmp++

Jochen Katz katz at agentpp.com
Wed Jul 4 21:22:59 CEST 2007


Hi,

> Is there a way to redirect the AGENT++,SNMP++ log messages to a single file.
> 
> I have tried with the following piece of code in my application
> 
> DefaultLog::init(new AgentLogImpl(LOG_FILE_NAME));
> DefaultLog::log()->set_filter(ERROR_LOG, 5);
> DefaultLog::log()->set_filter(WARNING_LOG, 5);
> DefaultLog::log()->set_filter(EVENT_LOG, 5);
> DefaultLog::log()->set_filter(INFO_LOG, 5);
> DefaultLog::log()->set_filter(DEBUG_LOG, 8);

this code should do exactly what you want.

> But still the file name alone created in the given path but there is nothing in it.
> Can some one help me how to redirect the AGENT++,snmp++ logs into a single file.

Does the application recreate the file if you delete it? Do you still
get the log output on stdout?

Regards,
  Jochen




More information about the AGENTPP mailing list