类 LogBase

java.lang.Object
com.alibaba.csp.sentinel.log.LogBase

public class LogBase extends Object

The base config class for logging.

The default log base directory is ${user.home}/logs/csp/. We can use the LOG_DIR property to override it. The default log file name dose not contain pid, but if multi-instances of the same service are running in the same machine, we may want to distinguish the log file by process ID number. In this case, LOG_NAME_USE_PID property could be configured as "true" to turn on this switch.

作者:
Carpenter Lee, Eric Zhao
  • 字段详细资料

    • LOG_DIR

      public static final String LOG_DIR
      另请参阅:
    • LOG_NAME_USE_PID

      public static final String LOG_NAME_USE_PID
      另请参阅:
    • LOG_OUTPUT_TYPE

      public static final String LOG_OUTPUT_TYPE
      另请参阅:
    • LOG_CHARSET

      public static final String LOG_CHARSET
      另请参阅:
    • LOG_LEVEL

      public static final String LOG_LEVEL
      另请参阅:
    • LOG_OUTPUT_TYPE_FILE

      public static final String LOG_OUTPUT_TYPE_FILE
      Output biz log (e.g. RecordLog and CommandCenterLog) to file.
      另请参阅:
    • LOG_OUTPUT_TYPE_CONSOLE

      public static final String LOG_OUTPUT_TYPE_CONSOLE
      Output biz log (e.g. RecordLog and CommandCenterLog) to console.
      另请参阅:
    • LOG_CHARSET_UTF8

      public static final String LOG_CHARSET_UTF8
      另请参阅:
  • 构造器详细资料

    • LogBase

      public LogBase()
  • 方法详细资料

    • isLogNameUsePid

      public static boolean isLogNameUsePid()
      Whether log file name should contain pid. This switch is configured by LOG_NAME_USE_PID system property.
      返回:
      true if log file name should contain pid, return true, otherwise false
    • getLogBaseDir

      public static String getLogBaseDir()
      Get the log file base directory path, which is guaranteed ended with File.separator.
      返回:
      log file base directory path
    • getLogOutputType

      public static String getLogOutputType()
      Get the log file output type.
      返回:
      log output type, "file" by default
    • getLogCharset

      public static String getLogCharset()
      Get the log file charset.
      返回:
      the log file charset, "utf-8" by default
    • getLogLevel

      public static Level getLogLevel()