Hi All ,
i would like to debug snmp4j logs for each snmp request it is coming from an java application .
followed below approaches :
Approach 1) Enable Simple Logging
In the main class execute the following code before any SNMP4J code is executed statically or at runtime:
static {
LogFactory.setLogFactory(new ConsoleLogFactory());
ConsoleLogAdapter.setDebugEnabled(true);
}
Approach 2) Enable Log4J Logging
In the main class put:
static {
LogFactory.setLogFactory(new Log4jLogFactory());
org.apache.log4j.BasicConfigurator.configure();
LogFactory.getLogFactory().getRootLogger().setLogLevel(LogLevel.ALL);
}
Approach 3) Enable Java Logging
To enable Java logging two steps are necessary:
Code
static {
LogFactory.setLogFactory(new JavaLogFactory());
// Optionally set log level on root logger:
LogFactory.getLogFactory().getRootLogger().setLogLevel(LogLevel.ALL);
}
none of the above approach did not worked to push logs from snmp4j.jar to java application jar .
Any body suggest ?