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

如何在Apache access_log中忽略/移除ClusterListener/1.0日志记录

How to Exclude "ClusterListener/1.0" Entries from Apache access_log with mod_cluster

I’ve dealt with this exact mod_cluster log clutter before—those ClusterListener/1.0 entries are internal component communication (like node health checks and status syncs) that don’t need to cluttering up your access log. Adjusting LogLevel won’t fix this because that setting controls error log verbosity, not what gets logged to the access log. Here’s the straightforward fix:

Step 1: Tag the Unwanted Requests

All those noisy entries have a User-Agent header set to ClusterListener/1.0. Use Apache’s SetEnvIf directive to tag these requests so we can exclude them from logging. Add this line to either your main httpd.conf or directly in your mod_jk.conf:

# Mark ClusterListener requests to skip logging
SetEnvIf User-Agent "ClusterListener/1.0" dontlog

Step 2: Update Your Logging Rule

Modify your existing CustomLog directive to exclude any requests tagged with dontlog. If you’re using the standard combined log format, it should look like this:

# Only log requests that aren't marked as "dontlog"
CustomLog "logs/access_log" combined env=!dontlog

If you want to apply this only to your mod_cluster VirtualHost (port 5555) without affecting other sites, add the filter directly inside that <VirtualHost> block:

<VirtualHost *:5555>
    # Your existing mod_cluster configuration...
    LogLevel warn
    <Directory />
        Require all granted
    </Directory>
    <Location />
        Order deny,allow
        Allow from all
    </Location>
    ManagerBalancerName mybalancer
    ServerAdvertise on
    EnableMCPMReceive On
    <Location /mod_cluster-manager>
        SetHandler mod_cluster-manager
        Order deny,allow
        Allow from all
    </Location>

    # Add these lines to filter ClusterListener logs
    SetEnvIf User-Agent "ClusterListener/1.0" dontlog
    CustomLog "logs/mod_cluster_access_log" combined env=!dontlog
</VirtualHost>

Step 3: Verify the Fix

Restart Apache to apply the changes, then check your access log. Those ClusterListener/1.0 entries should disappear right away.

Quick Note on Why LogLevel Didn’t Work

To clear up confusion: LogLevel adjusts how much detail is written to Apache’s error log (e.g., hiding debug messages or showing more warnings). It has no control over which requests get recorded in the access log—those are managed by CustomLog directives and environment variables like the one we used here.

内容的提问来源于stack exchange,提问作者Thiago Chagas - Batata

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.15 04:05:49