English | Japanese

ダウンロード

ダウンロード
log4twitter-1.0.zip

Log4Twitterとは?

Log4Twitter は Log4j, Logback に組み込んで使う Appender プラグインで、名前の通りメッセージを twitter に書き出すことができます。
Log4Twitter を使うと Log4j, Logback を使ったアプリケーションに手を加えることなく twitter と連携させることができます。

システム要件

OS: Java をサポートする Windows または Unix 系 OS
JVM: JDK1.4.2 以降
ログフレームワーク: Log4j1.2.x 以降 または Logback 0.9.6 以降

使い方

  1. クラスパスの設定
  2. log4twitter-1.0.jar をアプリケーションのクラスパスに通します。
    利用しているログフレームワークと同じ階層のクラスローダで読み込まれるようにしてください。

  3. Logger の設定
  4. ログフレームワークの設定ファイルを書き換えて、Log4Twitter を有効にします。
    Log4Twitter の Appender クラスは "log4twitter.FRAMEWORK.TwitterAppender" です。
    ・Logback 用の最小限の設定

    <configuration>
      <appender name="twitter"
        class="log4twitter.logback.TwitterAppender">
        <id>YOUR_TWITTER_ID</id>
        <password>YOUR_TWITTER_PASSWORD</password>
        <layout class="ch.qos.logback.classic.PatternLayout">
          <pattern>%msg%n</pattern>
        </layout>
      </appender>
      <root>
        <level value="debug" />
        <appender-ref ref="twitter" />
      </root>
    </configuration>
    ・Log4j 用の最小限の設定
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
        <appender name="twitter" class="log4twitter.log4j.TwitterAppender" >
            <param name="id" value="YOUR_TWITTER_ID"/>
            <param name="password" value="YOUR_TWITTER_PASSWORD"/>
            <layout class="org.apache.log4j.PatternLayout">
                <param name="ConversionPattern" value="%m%n"/>
            </layout>
        </appender>
        <root>
            <level value="DEBUG"/>
            <appender-ref ref="twitter"/>
        </root>
    </log4j:configuration>
    これで準備は完了です。通常通りアプリケーションを稼働させてください。

  5. オプション設定
  6. オプション名 デフォルト値 必須 説明
    idN/Ayestwitterのid
    passwordN/Ayestwitterのパスワード
    asynctruenotrue だとメッセージを非同期で書き出す(推奨)
    includeN/Ano書き出し対象の正規表現ポジティブフィルタ。この正規表現にマッチしないログは Twitter に送られません。
    excludeN/Ano書き出し非対象の正規表現ネガティブフィルタ。この正規表現にマッチするログは Twitter に送られません。
    retryCount0noリトライ回数
    retryIntervalSecs10noリトライ間隔(秒)
    subscribersN/Anoダイレクトメッセージ受信者(カンマ区切り)

メーリングリスト

Twitter4J に関する質問、バグレポート、リクエストなどありましたら以下のメーリングリストにお気軽にどうぞ。
Google グループ
Log4Twitter Jに参加
メール アドレス:
このグループにアクセス
また既出のバグ、機能追加予定については Jira に登録していく予定です。
Jira へ

ライセンス

Log4Twitter は BSD ライセンスに基づいてリリースされています。
Log4Twitter にバンドルされている Apache Commons CodecApache Software License に基づいています。
Log4Twitter にバンドルされている Apache Log4jApache Software License に基づいています。
Log4Twitter にバンドルされている LogbackGNU Lesser General Public License に基づいています。

Copyright (c) 2007, Yusuke Yamamoto
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the Yusuke Yamamoto nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

価格

Log4Twitter はどなたでも商標、非商用にかかわらず無償でご利用いただけます。
もし Log4Twitter があなたの生活を豊かにしてくれると感じたならば、以下の PayPal バッジから寄付していただくことも可能です。

変更履歴

Todo