|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectorg.seasar.util.log.Logger
public class Logger
ログ出力を提供するクラスです。
| 入れ子のクラスの概要 | |
|---|---|
static class |
Logger.LogLevel
ログの出力レベルです。 |
static class |
Logger.LogMessage
ログ出力するメッセージです。 |
| フィールドの概要 | |
|---|---|
protected static org.seasar.util.log.LoggerAdapterFactory |
factory
ロガーアダプタのファクトリ |
protected static Map<Class<?>,Logger> |
loggers
クラスをキーとするロガー のマップ |
| コンストラクタの概要 | |
|---|---|
protected |
Logger(Class<?> clazz)
インスタンスを構築します。 |
| メソッドの概要 | |
|---|---|
void |
debug(Object message)
DEBUG情報を出力します。 |
void |
debug(Object message,
Throwable throwable)
DEBUG情報を出力します。 |
void |
error(Object message)
ERROR情報を出力します。 |
void |
error(Object message,
Throwable throwable)
ERROR情報を出力します。 |
void |
fatal(Object message)
FATAL情報を出力します。 |
void |
fatal(Object message,
Throwable throwable)
FATAL情報を出力します。 |
static Logger.LogMessage |
format(String messageCode,
Object... args)
フォーマットされたメッセージ文字列を返します。 |
static Logger |
getLogger(Class<?> clazz)
Loggerを返します。 |
protected static org.seasar.util.log.LoggerAdapterFactory |
getLoggerAdapterFactory()
ログアダプタのファクトリを返します。 |
void |
info(Object message)
INFO情報を出力します。 |
void |
info(Object message,
Throwable throwable)
INFO情報を出力します。 |
protected static void |
initialize()
Loggerを初期化します。 |
boolean |
isDebugEnabled()
DEBUG情報が出力されるかどうかを返します。 |
protected boolean |
isEnabledFor(Logger.LogLevel logLevel)
指定のログレベルが有効ならtrueを返します. |
boolean |
isInfoEnabled()
INFO情報が出力されるかどうかを返します。 |
void |
log(Logger.LogMessage logMessage)
ログを出力します。 |
void |
log(Logger.LogMessage logMessage,
Throwable throwable)
ログを出力します。 |
void |
log(String messageCode,
Object... args)
ログを出力します。 |
void |
log(Throwable throwable)
ログを出力します。 |
protected static String |
toString(Object message)
メッセージオブジェクトの文字列表現を返します。 |
void |
warn(Object message)
WARN情報を出力します。 |
void |
warn(Object message,
Throwable throwable)
WARN情報を出力します。 |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
|---|
protected static final org.seasar.util.log.LoggerAdapterFactory factory
protected static final Map<Class<?>,Logger> loggers
| コンストラクタの詳細 |
|---|
protected Logger(Class<?> clazz)
clazz - ログ出力のカテゴリとなるクラス| メソッドの詳細 |
|---|
public static Logger getLogger(Class<?> clazz)
Loggerを返します。
clazz - ロガーのカテゴリとなるクラス。nullであってはいけません
Logger
public static Logger.LogMessage format(String messageCode,
Object... args)
messageCode - メッセージコード。nullや空文字列であってはいけませんargs - 引数
protected static void initialize()
Loggerを初期化します。
protected static org.seasar.util.log.LoggerAdapterFactory getLoggerAdapterFactory()
Commons Loggingが使える場合はCommons Loggingを利用するためのファクトリを返します。 使えない場合はjava.util.loggingロガーを利用するためのファクトリを返します。
public boolean isDebugEnabled()
public void debug(Object message,
Throwable throwable)
message - メッセージthrowable - 例外public void debug(Object message)
message - メッセージpublic boolean isInfoEnabled()
public void info(Object message,
Throwable throwable)
message - メッセージthrowable - 例外public void info(Object message)
message - メッセージ
public void warn(Object message,
Throwable throwable)
message - メッセージthrowable - 例外public void warn(Object message)
message - メッセージ
public void error(Object message,
Throwable throwable)
message - メッセージthrowable - 例外public void error(Object message)
message - メッセージ
public void fatal(Object message,
Throwable throwable)
message - メッセージthrowable - 例外public void fatal(Object message)
message - メッセージpublic void log(Throwable throwable)
throwable - 例外。nullであってはいけません
public void log(String messageCode,
Object... args)
messageCode - メッセージコード。nullや空文字列であってはいけませんargs - 引数public void log(Logger.LogMessage logMessage)
ログメッセージはformat(String, Object...)メソッドで作成します。
format(String, Object...)をstatic importしておくと便利です。
import static org.seasar.util.log.Logger.format;
Logger logger = Logger.getLogger(Xxx.class);
logger.log(format("DXXX0000", arg1, arg2, arg3));
logMessage - ログメッセージ。nullであってはいけません
public void log(Logger.LogMessage logMessage,
Throwable throwable)
ログメッセージはformat(String, Object...)メソッドで作成します。
format(String, Object...)をstatic importしておくと便利です。
import static org.seasar.util.log.Logger.format;
Logger logger = Logger.getLogger(Xxx.class);
logger.log(format("DXXX0000", arg1, arg2, arg3), t);
logMessage - ログメッセージ。nullであってはいけませんthrowable - 例外protected boolean isEnabledFor(Logger.LogLevel logLevel)
logLevel - ログレベル
protected static String toString(Object message)
message - メッセージオブジェクト
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||