public class LogBase extends Object
LOG_DIR System property to override it.
Default log file name dose not contain pid, but if multi instances of the same app are running in the same
machine, we may want to distinguish the log file by pid number, in this case, LOG_NAME_USE_PID
System property could be configured as "true" to turn on this switch.| Modifier and Type | Field and Description |
|---|---|
static String |
LOG_CHARSET |
static String |
LOG_DIR |
static String |
LOG_NAME_USE_PID |
static String |
LOG_OUTPUT_TYPE |
static String |
LOG_OUTPUT_TYPE_CONSOLE |
static String |
LOG_OUTPUT_TYPE_FILE |
| Constructor and Description |
|---|
LogBase() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getLogBaseDir()
Get log file base directory path, the returned path is guaranteed end with
File.separator |
static boolean |
isLogNameUsePid()
Whether log file name should contain pid.
|
protected static void |
log(Logger logger,
Handler handler,
Level level,
String detail,
Object... params) |
protected static void |
log(Logger logger,
Handler handler,
Level level,
String detail,
Throwable throwable) |
protected static Handler |
makeLogger(String logName,
Logger heliumRecordLog) |
public static final String LOG_CHARSET
public static final String LOG_OUTPUT_TYPE_FILE
public static final String LOG_OUTPUT_TYPE_CONSOLE
public static final String LOG_OUTPUT_TYPE
public static final String LOG_DIR
public static final String LOG_NAME_USE_PID
public static boolean isLogNameUsePid()
LOG_NAME_USE_PID System property.protected static void log(Logger logger, Handler handler, Level level, String detail, Object... params)
protected static void log(Logger logger, Handler handler, Level level, String detail, Throwable throwable)
public static String getLogBaseDir()
File.separatorCopyright © 2019 Alibaba Group. All rights reserved.