Thiago Chagas - Batata
Thiago Chagas - Batata

Reputation: 315

Ignore / remove log patterns in Apache's access_log

I have a working Apache with mod_cluster with a minimal configuration:

(mod_jk.conf)

LoadModule cluster_slotmem_module modules/mod_cluster_slotmem.so
LoadModule manager_module modules/mod_manager.so
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule advertise_module modules/mod_advertise.so    

Listen 5555    
<VirtualHost *:5555>

  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>
</VirtualHost>

My problem is, in my access_log I have:

...
ClusterListener/1.0
ClusterListener/1.0
ClusterListener/1.0
ClusterListener/1.0
ClusterListener/1.0
ClusterListener/1.0
ClusterListener/1.0
ClusterListener/1.0
ClusterListener/1.0
ClusterListener/1.0
ClusterListener/1.0
ClusterListener/1.0
...

I don't want to log these 'ClusterListener/1.0' in my access_log.

I've tried to change my LogLevel in httpd.conf:

...
LogLevel warn
...

And I've tried to put 'LogLevel' in my mod_jk.conf

However, these options didn't work. What do I need to do to remove these logs?

Upvotes: 1

Views: 541

Answers (1)

Thiago Chagas - Batata
Thiago Chagas - Batata

Reputation: 315

I've found the solution. I undo the 'LogLevel warn' to the original configuration , because this doesn't solve the problem. Sharing with all.

All I had to do is to add this to my httpd.conf:

<IfModule log_config_module>
    #....

    SetEnvIf User-Agent "ClusterListener/1\.0" dontlog

    CustomLog "logs/access_log" env=!dontlog

     #...
</IfModule>

And now, my access_log doesn't have more the "ClusterListener" logs.

Upvotes: 1

Related Questions