3

My mod_jk.log gets 2MB bigger in an hour and all it has entries like :

[Mon Aug 13 10:51:28 2012] ajp13 www.my_site.com 0.690152
[Mon Aug 13 10:51:28 2012] ajp13 www.my_site.com 0.002675
[Mon Aug 13 10:51:29 2012] ajp13 www.my_site.com 0.000794
[Mon Aug 13 10:51:30 2012] ajp13 www.my_site.com 0.001993
[Mon Aug 13 10:51:30 2012] ajp13 www.my_site.com 0.000764
[Mon Aug 13 10:51:35 2012] ajp13 www.my_site.com 0.004724

So, how can I disable this logging completely?

Currently I have set logLevel to info in configuration file. Apache tomcat doc suggests, error/debug/info are only valid option.

Please help.

Also how can I rotate log after one day? Currently it's being rotated after week by default (I did not write/change anything for that).

Thanks.

Shatiz
  • 135
  • 1
  • 4
  • 1
    Setting log level to error might decrease log size. I you really want to disable it, you can try `JkLogFile /dev/null`. Changing how log files are rotated might depend on your os (if you installed modjk from packages). Can you provide information about it? –  Aug 13 '12 at 09:46

1 Answers1

2

So, how can I disable this logging completely?

Point it to /dev/null:

JkLogFile           /dev/null
JkLogLevel          info

Also how can I rotate log after one day? Currently it's being rotated after week by default (I did not write/change anything for that).

Add a daily directive to the /etc/logrotate.d/httpd:

/var/log/httpd/*log {
    missingok
    notifempty
    daily
    sharedscripts
    postrotate
        /sbin/service httpd reload > /dev/null 2>/dev/null || true
    endscript
}
quanta
  • 51,413
  • 19
  • 159
  • 217