<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="https://tm.root-n.com/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel>
        <title>Tipsというかメモ server:apache:customlog</title>
        <description></description>
        <link>https://tm.root-n.com/</link>
        <lastBuildDate>Tue, 18 Nov 2025 18:22:44 +0900</lastBuildDate>
        <generator>FeedCreator 1.7.2-ppt DokuWiki</generator>
        <image>
            <url>https://tm.root-n.com/lib/images/favicon.ico</url>
            <title>Tipsというかメモ</title>
            <link>https://tm.root-n.com/</link>
        </image>
        <item>
            <title>apache :: PHPプログラム(スクリプト)の変数値をログに出力する</title>
            <link>https://tm.root-n.com/server:apache:customlog:apache_setenv</link>
            <description>例えば、ある画面で複数のバナー広告をランダム表示しているとして、それらの各バナーの表示回数を集計する必要に迫られたとする。

対応方法として、phpスクリプト内で独自にカウントするロジックを組んでもよいが、apacheのログを利用する手もある。(こちらの方がお手軽)

具体的には、各バナーにIDを振っておき、表示時にIDをログに吐くように設定する。

集計の際は、grep コマンドと wc コマンドを組み合わせて、IDをカウントすればよい。…</description>
        <category>server:apache:customlog</category>
            <pubDate>Sun, 16 Mar 2008 22:48:24 +0900</pubDate>
        </item>
        <item>
            <title>apache :: ケータイ端末の端末識別情報をログに出力する</title>
            <link>https://tm.root-n.com/server:apache:customlog:device_info</link>
            <description>au, SoftBank
LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot; 
\&quot;%{X-UP-SUBNO}i\&quot; \&quot;%{X-JPHONE-UID}i\&quot;&quot; combined見やすいように改行を入れているが、本来は一行で書く。





DoCoMo

上記 au, SoftBank に加え、DoCoMo の端末識別情報は、</description>
        <category>server:apache:customlog</category>
            <pubDate>Sun, 16 Mar 2008 22:48:24 +0900</pubDate>
        </item>
        <item>
            <title>apache :: ログフォーマットの各パラメータの意味</title>
            <link>https://tm.root-n.com/server:apache:customlog:params</link>
            <description>LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; combined%h ホスト名 訪問者のIPアドレスまたはドメイン名
%l 識別情報 クライアントについての識別情報
%u 認証ユーザー 認証済みユーザー名(Basic認証が必要な場合)
%t 日時 リクエスト日時
%r リクエスト 送信してきたリクエストの内容(httpヘッダの GET リクエスト)
%s ステータス クライアントに送信されたHTTPステータスコード
%b バイト数 クライアントに送信されたファイルのサイズ
%{Referer}i リファラ
%{User-Agent}i ユーザエージェント…</description>
        <category>server:apache:customlog</category>
            <pubDate>Sun, 16 Mar 2008 22:48:24 +0900</pubDate>
        </item>
    </channel>
</rss>
