user784316
user784316

Reputation:

Denote ipv6 entry in apache log

I have a server setup with an ipv4 and an ipv6 address. When someone using ipv6 is connecting, the ipv6 address shows up in the apache logs. When someone using ipv4 is connecting, the ipv4 address shows up in the apache logs.

Recently, it was decided to not log the ip of the one who requests the page. However, this makes it difficult to determine if the user who connected did so through ipv4 or ipv6. Therefore, my question is: Is it possible to create something in the log that denotes the client used ipv6? Maybe just a "v6" at the end of the line or something.

This is what the log part of my virtual host config looks like:

LogFormat "0.0.0.0 - - %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %V" noip
CustomLog /var/www/example.com/logs/access.log noip

Please don't start a discussion wether or not to log ip's. It is not what my question is about. Thank you.

Upvotes: 0

Views: 2457

Answers (1)

Alnitak
Alnitak

Reputation: 340045

If you add %A (local IP address) this should indicate whether the connection arrived over the local system's IPv4 address or its IPv6 address.

Upvotes: 2

Related Questions