简体   繁体   中英

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.

如果添加%A (本地IP地址),则这应指示连接是通过本地系统的IPv4地址还是其IPv6地址到达。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM