Showing posts with label Apache. Show all posts
Showing posts with label Apache. Show all posts

Sunday, May 04, 2008

Apacheのログに携帯のユーザIDを記録する

iモードIDの登場に伴って、三キャリアのユーザIDはすべてHTTPリクエストヘッダから取れるようになった。Apacheの場合、下記ような設定でユーザIDはログに記録される。
SetEnvIf X-DCMGUID    ^(.+)$ User-ID=$1
SetEnvIf X-UP-SUBNO ^(.+)$ User-ID=$1
SetEnvIf X-JPHONE-UID ^(.+)$ User-ID=$1
CustomLog "logs/access_log" "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{User-ID}e\""