Enum Class LogLevel

java.lang.Object
java.lang.Enum<LogLevel>
nablarch.core.log.basic.LogLevel
All Implemented Interfaces:
Serializable, Comparable<LogLevel>, Constable

@Published(tag="architect") public enum LogLevel extends Enum<LogLevel>
ログレベルを表す列挙型。

本フレームワークにおけるログレベルは、FATAL>ERROR>WARN>INFO>DEBUG>TRACEの6段階とし、FATALからTRACEに向かって順にレベルが低くなる。

レベルに応じた出力制御では、指定されたレベル以上のログを全て出力する。
例えば、WARNレベルが指定された場合は、FATALレベル,ERRORレベル,WARNレベルで出力を指示しているログのみ出力する。

ログレベルの定義を下記に示す。
下記を参考にプロジェクト毎にログレベルの使用方法を決定すること。
FATAL
アプリケーションの継続が不可能になる深刻な問題が発生したことを示す。
監視が必須で即通報および即対応が必要となる。
通常は、運用監視体制と密接に関わるため、個別アプリケーションではなくフレームワークで出力する。
ERROR
アプリケーションの継続に支障をきたす問題が発生したことを示す。
監視が必須であるが、通報および対応にFATALレベルほどの緊急性がない。
通常は、運用監視体制と密接に関わるため、個別アプリケーションではなくフレームワークで出力する。
WARN
すぐには影響を与えないが、放置しておくとアプリケーションの継続に支障をきたす問題になる恐れがある事象が発生したことを示す。
できれば監視した方がよいが、ERRORレベルほどの重要性がない。
通常は、運用監視体制と密接に関わるため、個別アプリケーションではなくフレームワークで出力する。
INFO
本番運用時にアプリケーションの情報を出力するログレベル。
アクセスログや統計ログが該当する。
通常は、運用監視体制と密接に関わるため、個別アプリケーションではなくフレームワークで出力する。
ログファイルのサイズが肥大化しないよう出力内容を設計する。
DEBUG
開発時にデバッグ情報を出力するログレベル。
SQLログや性能ログが該当する。
本番運用時は、ログファイルのサイズが肥大化するため出力してはならない。
TRACE
開発時にデバッグ情報より、さらに細かい情報を出力したい場合に使用するログレベル。
本番運用時は、ログファイルのサイズが肥大化するため出力してはならない。
  • Enum Constant Details

    • FATAL

      public static final LogLevel FATAL
      致命的なエラー
    • ERROR

      public static final LogLevel ERROR
      エラー
    • WARN

      public static final LogLevel WARN
      ワーニング
    • INFO

      public static final LogLevel INFO
      情報
    • DEBUG

      public static final LogLevel DEBUG
      デバッグ
    • TRACE

      public static final LogLevel TRACE
      トレース
  • Method Details

    • values

      public static LogLevel[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static LogLevel valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public int getValue()
      ログレベルの値を取得する。
      Returns:
      ログレベルの値