Reputation: 39
I have a jar run from jmeter, for stress. This jar contains a class that writes to the log via logj4. If I run the jar from my development environment (like eclipse), it writes to the log file, in the path indicated in the log4j configuration. But if I run this jar from jmeter it doesn't write the log file. It seems to me that jmeter unwrites the log file and only writes to its own console log.
Is this happening due to some own jmeter setting preventing the jar from writing to the log file set in log4j.properties?
Upvotes: 0
Views: 355
Reputation: 168147
JMeter has its own logging configuration which lives under log4j2.xml file (located in "bin" folder of your JMeter installation)
If you need to integrate your .jar logging with JMeter logging subsystem you need to make sure to use SLF4J library
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
//some other code
private static final Logger log = LoggerFactory.getLogger(YourClass.class);
and add an entry to the JMeter's log4j2.xml file with the desired logging level for your code:
<Logger name="your.package.YourClass" level="debug" />
More information:
Upvotes: 1