|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectorg.apache.commons.logging.impl.SimpleLog
ロガーの定義に関係なく、有効化されたすべてのログメッセージを System.err に送るシンプルな Log (インターフェイス)の実装です。 このロガーの振る舞いを設定するために、以下のシステムプロパティがサポートされます:
org.apache.commons.logging.simplelog.defaultlog -
すべての SimpleLog インスタンスのデフォルトのログ出力レベルです。
("trace"、"debug"、"info"、"warn"、"error"、"fatal")のうちのどれか一つを設定する必要があります。
設定されない場合のデフォルトは "info" です。org.apache.commons.logging.simplelog.log.xxxxx -
"xxxxx" という名称の SimpleLog インスタンスのデフォルトのログ出力レベルです。
("trace"、"debug"、"info"、"warn"、"error"、"fatal")のうちのどれか一つを設定する必要があります。
設定されない場合にはデフォルトのログ出力レベルが適用されます。org.apache.commons.logging.simplelog.showlogname -
出力メッセージ内に Log インスタンス名を含めたい場合には
true を設定してください。
デフォルトの値は false です。org.apache.commons.logging.simplelog.showShortLogname -
出力メッセージ内に Log インスタンス名の最後の部分を含めたい場合には
true を設定してください。
デフォルトの値は true です。org.apache.commons.logging.simplelog.showdatetime -
出力メッセージ内に現在の日付と時間を含めたい場合には
true を設定してください。
デフォルトの値は false です。org.apache.commons.logging.simplelog.defaultlog -
Default logging detail level for all instances of SimpleLog.
Must be one of ("trace", "debug", "info", "warn", "error", or "fatal").
If not specified, defaults to "info". org.apache.commons.logging.simplelog.log.xxxxx -
Logging detail level for a SimpleLog instance named "xxxxx".
Must be one of ("trace", "debug", "info", "warn", "error", or "fatal").
If not specified, the default logging detail level is used.org.apache.commons.logging.simplelog.showlogname -
Set to true if you want the Log instance name to be
included in output messages. Defaults to false.org.apache.commons.logging.simplelog.showShortLogname -
Set to true if you want the last componet of the name to be
included in output messages. Defaults to true.org.apache.commons.logging.simplelog.showdatetime -
Set to true if you want the current date and time
to be included in output messages. Default is false.上記システムプロパティを探す際に、この実装は "simplelog.properties"
という名称のクラスローダリソースもチェックし、(存在すれば)すべての合致する定義をインクルードします。
"simplelog.properties", and includes any matching definitions
from this resource (if it exists).
| フィールドの概要 | |
protected int |
currentLogLevel
現在のログレベル。 |
protected static DateFormat |
dateFormatter
使用される日時のフォーマット。 |
static int |
LOG_LEVEL_ALL
全てのログレベルを有効に。 |
static int |
LOG_LEVEL_DEBUG
"デバッグ"レベルのログ処理。 |
static int |
LOG_LEVEL_ERROR
"エラー"レベルのログ処理。 |
static int |
LOG_LEVEL_FATAL
"致命的"レベルのログ処理。 |
static int |
LOG_LEVEL_INFO
"情報"レベルのログ処理。 |
static int |
LOG_LEVEL_OFF
全てのログレベルを無効に。 |
static int |
LOG_LEVEL_TRACE
"トレース"レベルのログ処理。 |
static int |
LOG_LEVEL_WARN
"警告"レベルのログ処理。 |
protected String |
logName
このシンプルログインスタンスの名称。 |
private String |
prefix
|
protected static boolean |
showDateTime
ログメッセージ内に現在の日時を含めるかどうか。 |
protected static boolean |
showLogName
ログメッセージ内にインスタンス名を含めるかどうか。 |
protected static boolean |
showShortName
ログメッセージ内にロガーの省略名(最後の部分)を含めるかどうか。 |
protected static Properties |
simpleLogProps
simplelog.properties リソースファイルからロードされた Properties。 |
protected static String |
systemPrefix
Simple で使用される全てのシステムプロパティはこの名称から始まります。
|
| コンストラクタの概要 | |
SimpleLog(String name)
指定された名称でシンプルログインスタンスを生成します。 |
|
| メソッドの概要 | |
void |
debug(Object message)
debug ログレベルでメッセージをログ出力します。 |
void |
debug(Object message,
Throwable t)
debug ログレベルでエラーをログ出力します。 |
void |
error(Object message)
error ログレベルでメッセージをログ出力します。 |
void |
error(Object message,
Throwable t)
error ログレベルでエラーをログ出力します。 |
void |
fatal(Object message)
fatal ログレベルでメッセージをログ出力します。 |
void |
fatal(Object message,
Throwable t)
fatal ログレベルでエラーをログ出力します。 |
private static boolean |
getBooleanProperty(String name,
boolean dephault)
|
private static ClassLoader |
getContextClassLoader()
スレッドコンテキストクラスローダが利用できる場合には、それを返します。 |
int |
getLevel()
ログ処理のレベルを取得します。 |
private static InputStream |
getResourceAsStream(String name)
|
private static String |
getStringProperty(String name)
|
private static String |
getStringProperty(String name,
String dephault)
|
void |
info(Object message)
info ログレベルでメッセージをログ出力します。 |
void |
info(Object message,
Throwable t)
info ログレベルでエラーをログ出力します。 |
boolean |
isDebugEnabled()
debug メッセージが現在有効かどうかをチェックします。 |
boolean |
isErrorEnabled()
error メッセージが現在有効かどうかをチェックします。 |
boolean |
isFatalEnabled()
fatal メッセージが現在有効かどうかをチェックします。 |
boolean |
isInfoEnabled()
info メッセージが現在有効かどうかをチェックします。 |
protected boolean |
isLevelEnabled(int logLevel)
指定されたログレベルが現在有効かどうかチェックします。 |
boolean |
isTraceEnabled()
trace メッセージが現在有効かどうかをチェックします。 |
boolean |
isWarnEnabled()
warn メッセージが現在有効かどうかをチェックします。 |
protected void |
log(int type,
Object message,
Throwable t)
実際のログ処理を実施します。 |
void |
setLevel(int currentLogLevel)
ログ処理のレベルを設定します。 |
void |
trace(Object message)
trace ログレベルでメッセージをログ出力します。 |
void |
trace(Object message,
Throwable t)
trace ログレベルでエラーをログ出力します。 |
void |
warn(Object message)
warn ログレベルでメッセージをログ出力します。 |
void |
warn(Object message,
Throwable t)
warn ログレベルでエラーをログ出力します。 |
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
protected static final String systemPrefix
Simple で使用される全てのシステムプロパティはこの名称から始まります。
Simple start with this
protected static final Properties simpleLogProps
protected static boolean showLogName
protected static boolean showShortName
protected static boolean showDateTime
protected static DateFormat dateFormatter
public static final int LOG_LEVEL_TRACE
public static final int LOG_LEVEL_DEBUG
public static final int LOG_LEVEL_INFO
public static final int LOG_LEVEL_WARN
public static final int LOG_LEVEL_ERROR
public static final int LOG_LEVEL_FATAL
public static final int LOG_LEVEL_ALL
public static final int LOG_LEVEL_OFF
protected String logName
protected int currentLogLevel
private String prefix
| コンストラクタの詳細 |
public SimpleLog(String name)
name - log name
| メソッドの詳細 |
private static String getStringProperty(String name)
private static String getStringProperty(String name,
String dephault)
private static boolean getBooleanProperty(String name,
boolean dephault)
public void setLevel(int currentLogLevel)
ログ処理のレベルを設定します。
currentLogLevel - 新しいログ処理のレベル
public int getLevel()
ログ処理のレベルを取得します。
protected void log(int type,
Object message,
Throwable t)
実際のログ処理を実施します。
このメソッドはメッセージを組み立てて、 System.err に出力します。
System.err.
protected boolean isLevelEnabled(int logLevel)
logLevel - 有効かどうか確認するログレベル
public final void debug(Object message)
debug ログレベルでメッセージをログ出力します。
Log 内の debugmessage - このメッセージをログします
public final void debug(Object message,
Throwable t)
debug ログレベルでエラーをログ出力します。
Log 内の debugmessage - このメッセージをログ出力します
t - この原因(となった例外)をログ出力します
public final void trace(Object message)
trace ログレベルでメッセージをログ出力します。
Log 内の tracemessage - このメッセージをログ出力します
public final void trace(Object message,
Throwable t)
trace ログレベルでエラーをログ出力します。
Log 内の tracemessage - このメッセージをログ出力します
t - この原因(となった例外)をログ出力します
public final void info(Object message)
info ログレベルでメッセージをログ出力します。
Log 内の infomessage - このメッセージをログ出力します
public final void info(Object message,
Throwable t)
info ログレベルでエラーをログ出力します。
Log 内の infomessage - このメッセージをログ出力します
t - この原因(となった例外)をログ出力します
public final void warn(Object message)
warn ログレベルでメッセージをログ出力します。
Log 内の warnmessage - このメッセージをログ出力します
public final void warn(Object message,
Throwable t)
warn ログレベルでエラーをログ出力します。
Log 内の warnmessage - このメッセージをログ出力します
t - この原因(となった例外)をログ出力します
public final void error(Object message)
error ログレベルでメッセージをログ出力します。
Log 内の errormessage - このメッセージをログ出力します
public final void error(Object message,
Throwable t)
error ログレベルでエラーをログ出力します。
Log 内の errormessage - このメッセージをログ出力します
t - この原因(となった例外)をログ出力します
public final void fatal(Object message)
fatal ログレベルでメッセージをログ出力します。
Log 内の fatalmessage - このメッセージをログ出力します
public final void fatal(Object message,
Throwable t)
fatal ログレベルでエラーをログ出力します。
Log 内の fatalmessage - このメッセージをログ出力します
t - この原因(となった例外)をログ出力します
public final boolean isDebugEnabled()
debug メッセージが現在有効かどうかをチェックします。
このメソッドにて事前にチェックすることによりロガーのメッセージが無効な場合に
String の連結のような不要な重い処理を避けることができます。
String
concatenation to be avoided when the message will be ignored by the
logger.
Log 内の isDebugEnabledpublic final boolean isErrorEnabled()
error メッセージが現在有効かどうかをチェックします。
このメソッドにて事前にチェックすることによりロガーのメッセージが無効な場合に
String の連結のような不要な重い処理を避けることができます。
String
concatenation to be avoided when the message will be ignored by the
logger.
Log 内の isErrorEnabledpublic final boolean isFatalEnabled()
fatal メッセージが現在有効かどうかをチェックします。
このメソッドにて事前にチェックすることによりロガーのメッセージが無効な場合に
String の連結のような不要な重い処理を避けることができます。
String
concatenation to be avoided when the message will be ignored by the
logger.
Log 内の isFatalEnabledpublic final boolean isInfoEnabled()
info メッセージが現在有効かどうかをチェックします。
このメソッドにて事前にチェックすることによりロガーのメッセージが無効な場合に
String の連結のような不要な重い処理を避けることができます。
String
concatenation to be avoided when the message will be ignored by the
logger.
Log 内の isInfoEnabledpublic final boolean isTraceEnabled()
trace メッセージが現在有効かどうかをチェックします。
このメソッドにて事前にチェックすることによりロガーのメッセージが無効な場合に
String の連結のような不要な重い処理を避けることができます。
String
concatenation to be avoided when the message will be ignored by the
logger.
Log 内の isTraceEnabledpublic final boolean isWarnEnabled()
warn メッセージが現在有効かどうかをチェックします。
このメソッドにて事前にチェックすることによりロガーのメッセージが無効な場合に
String の連結のような不要な重い処理を避けることができます。
String
concatenation to be avoided when the message will be ignored by the
logger.
Log 内の isWarnEnabledprivate static ClassLoader getContextClassLoader()
LogConfigurationException - 適切なクラスローダを認識できなかった場合。
private static InputStream getResourceAsStream(String name)
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||