|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Object
|
+--org.apache.log4j.Category
|
+--org.apache.log4j.examples.MyCategory
A simple example showing category subclassing.
カテゴリーのサブクラス化を示すための簡単な例です。
The example should make it clear that subclasses follow the hierarchy. You should also try running this example with a bad and good configuration file samples.
この例により、サブクラスが階層に追従していることがはっきりわかります。 また、あなたは、設定ファイルのサンプル bad と good を使ってこの例を起動してみるといいでしょう。
See source code for more details.
さらに詳細は、ソース・コードを参照してください。
| クラス org.apache.log4j.Category から継承したフィールド |
additive, DEFAULT_CONFIGURATION_FILE, DEFAULT_CONFIGURATION_KEY, DEFAULT_INIT_OVERRIDE_KEY, defaultHierarchy, hierarchy, name, parent, priority, resourceBundle |
| コンストラクタの概要 | |
MyCategory(String name)
Just calls the parent constuctor. |
|
| メソッドの概要 | |
void |
debug(String message)
Overrides the standard debug method by appending " world" at the end of each message. |
static Category |
getInstance(String name)
This method overrides Category.getInstance(java.lang.String) by supplying
its own factory type as a parameter.
|
static void |
main(String[] args)
When called wihtout arguments, this program will just print DEBUG [main] some.cat - Hello world. |
void |
trace(String message)
|
| クラス org.apache.log4j.Category から継承したメソッド |
addAppender, assert, callAppenders, debug, debug, error, error, exists, fatal, fatal, forcedLog, getAdditivity, getAllAppenders, getAppender, getChainedPriority, getCurrentCategories, getDefaultHierarchy, getHierarchy, getInstance, getInstance, getName, getPriority, getResourceBundle, getResourceBundleString, getRoot, info, info, isDebugEnabled, isEnabledFor, isInfoEnabled, l7dlog, l7dlog, log, log, log, removeAllAppenders, removeAppender, removeAppender, setAdditivity, setPriority, setResourceBundle, shutdown, warn, warn |
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| コンストラクタの詳細 |
public MyCategory(String name)
単に親のコンストラクタを呼び出します。
| メソッドの詳細 |
public static void main(String[] args)
DEBUG [main] some.cat - Hello world.and exit.
引数なしで呼ばれれた時、このプログラムは、単に
DEBUG [main] some.cat - Hello world.とだけ出力し、終了します。
However, it can be called with a configuration file in XML or properties format.
しかし、XMLまたはプロパティのフォーマットで記述した設定ファイルを使って呼び出すこともできます。
public void debug(String message)
各メッセージの最後に " world" を追加するように標準のデバッグ・メソッドをオーバーライドします。
public static Category getInstance(String name)
Category.getInstance(java.lang.String) by supplying
its own factory type as a parameter.
このメソッドは、パラメータとして自分自身のファクトリのタイプを与えように Category.getInstance(java.lang.String) をオーバーライドします。
org.apache.log4j.Category からコピーされたタグ:name - The name of the category to retrieve.
name 取り出すカテゴリ名
public void trace(String message)
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||