Page 1 of 1

How to skip logging of one's own IP to apache2/access.log?

Posted: 26 Sep 2012, 18:06
by toukie
It's useless to have one's own IP to be shown in the /var/log/apache2/access.log. How can it be skipped? The instructions I found didn't work out, "CustomLog" was not allowed etc. I guess that it can be done, but how? It would give a much neater logfile.

Re: How to skip logging of one's own IP to apache2/access.lo

Posted: 27 Sep 2012, 03:37
by Binkem
Hi Toukie,

This is a good question, which I'm unfortunately not able to answer. It should be posted in the B2 & B3 support forum though. This part of the forum is for posting howto's explaining how to install/update/tweak a part of the B2/B3 software. If you've solved the qustion you might want to write the howto here :)

Martijn

Re: How to skip logging of one's own IP to apache2/access.lo

Posted: 27 Sep 2012, 07:18
by toukie
Hi Binkem,

You are probably right about posting but this thing falls somewhere between the categories. Support is more when things don't work, this was like a feature request.

Closest I came was this: http://www.electrictoolbox.com/apache-s ... onnection/ but I didn't find the things that are named there. Maybe there is a clue for someone who knows things better. Apache may have changed a bit, or there are different versions or whatever.

The thing can be done for sure. I'm waiting for the eventual Howto to be posted right here :D

Re: How to skip logging of one's own IP to apache2/access.lo

Posted: 27 Sep 2012, 15:30
by nobody
The easiest way to get rid of localhost is
Cat access_log | grep -v localhost
.
The second bes t solution i guess is splitting your host into two separate vhosts, both with a documentroot to the same position. Then make one point to the. Internal interface
<virtualhost 127.0.0.1:80>
and the other to the external inerface. Then finally set two separate log files. Domt forget to update syslog.conf as well..

Re: How to skip logging of one's own IP to apache2/access.lo

Posted: 27 Sep 2012, 17:26
by toukie
THNX nobody!
The alternative number 1 works fine when written as:
cat /var/log/apache2/access.log | grep -v xyz.xyz.xyz.xyz One's own IP is omitted, that's neat.

The other alternative flies far beyond my digital horizon.

Re: How to skip logging of one's own IP to apache2/access.lo

Posted: 02 Oct 2012, 04:57
by Gordon
nobody wrote:Then finally set two separate log files. Domt forget to update syslog.conf as well..
There's no need to update syslog. I use named hosts with separate log files myself and it works straight out of the box. Even log rotation is handled.

Re: How to skip logging of one's own IP to apache2/access.lo

Posted: 02 Oct 2012, 06:17
by nobody
apologies, I meant logrotate. Depending om what exotic logfilename you enter in the vhost config, you may very well need to add that name in /etc/logrotate.d/apache2. If you cal the file /var/log/apache/somehostfilename.log then it is automatically included.