You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在JMeter分布式测试中获取执行信息日志?

How to Get Execution Logs in JMeter Distributed Testing

I’ve dealt with this exact frustration before—when running JMeter in distributed mode, the master only shows connection logs, and you’re left wondering where all the actual test execution logs went. Here are the reliable ways to get those logs:

1. Configure Remote Nodes to Log Execution Details

First, you need to make sure each remote JMeter server (jmeter-server) is set up to write execution logs locally:

  • Edit jmeter.properties on remote nodes:
    Find the log_file property and uncomment/set it to a specific path, e.g.:
    log_file=/var/log/jmeter/jmeter-remote-${HOSTNAME}.log
    
    Using ${HOSTNAME} ensures each node gets a unique log file, making it easier to identify which logs belong to which server.
  • Adjust Log4j2 Configuration (for JMeter 3.2+):
    Modern JMeter uses Log4j2, so edit the log4j2.xml file in your JMeter bin directory on remote nodes. Add or modify a logger to capture JMeter execution logs:
    <Logger name="org.apache.jmeter" level="INFO" additivity="false">
        <AppenderRef ref="FILE"/>
    </Logger>
    
    You can tweak the level to DEBUG if you need more granular details. Don’t forget to restart the jmeter-server service on each node after making these changes.

2. Pull Logs from Remote Nodes to Your Master Machine

Once remote nodes are logging locally, you can retrieve the logs easily:

  • Use scp for single nodes:
    scp your-username@remote-node-ip:/var/log/jmeter/jmeter-remote-node1.log ./local-logs/
    
  • For multiple nodes, create a simple shell script to loop through all your remote servers and pull logs in bulk. This saves time if you have a cluster of nodes.

3. Real-Time Log Monitoring (For Debugging)

If you need to watch logs as the test runs (great for troubleshooting failures), use ssh with tail -f:

ssh your-username@remote-node-ip tail -f /var/log/jmeter/jmeter-remote-node1.log

This streams the remote log directly to your terminal in real time.

4. Bonus: Test-Specific Logging with Logging Config Element

Add a Logging Config element to your test plan to generate test-specific logs. You can set a custom log file path, log level, and even filter logs by sampler name. This complements the node-level logs and gives you more control over what’s logged for individual tests.

Just remember to keep your master and remote node JMeter versions identical—mismatched versions can cause unexpected log behavior or test failures.

内容的提问来源于stack exchange,提问作者Deepak N

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 07:48:49