org.zodiac.sdk.log.constants.LogConstants Maven / Gradle / Ivy
package org.zodiac.sdk.log.constants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.nio.charset.StandardCharsets;
public interface LogConstants {
/*Default logger, use ROOT logger if not configured in app.*/
Logger DEFAULT_LOG = LoggerFactory.getLogger("org.zodiac.commons.log");
String LOG_START = "*";
String LOG_DIRECTORY = "log";
String LOG_XML_CONFIG_FILE_NAME = "log-conf.xml";
String LOG_XML_CONFIG_FILE_ENV_PATTERN = "log-conf-%s.xml";
String LOG_CONFIG_PROPERTIES = "config.properties";
String PRIORITY_KEY = "priority";
String LOGGER_CONSOLE_WHITE_SET_KEY = "console";
String LOGGER_CONSOLE_PREFIX_WHITE_SET_KEY = "console.prefix";
String LOG_PATH = "logging.path";
String LOG_PATH_PREFIX = "logging.path.";
String OLD_LOG_PATH = "loggingRoot";
String LOG_LEVEL = "logging.level";
String LOG_LEVEL_PREFIX = "logging.level.";
String LOG_CONFIG_PREFIX = "logging.config.";
String DEFAULT_PLATFORM_SPACE_LOG_LEVEL = "INFO";
String IS_DEFAULT_LOG_PATH = "isDefaultLogPath";
String IS_DEFAULT_LOG_LEVEL = "isDefaultLogLevel";
/*Specify log conf file according different environment, such as log-conf-dev.xml .*/
/*Value pattern is similar to log.env.suffix=spaceName:dev&spaceName:test .*/
String LOG_ENV_SUFFIX = "log.env.suffix";
/*File encoding configured by VM option.*/
String LOG_ENCODING_PROP_KEY = "file.encoding";
/*Disable space log.*/
String PLATFORM_LOG_DISABLE_PROP_KEY = "platform.log.disable";
boolean PLATFORM_LOG_DISABLE = Boolean.TRUE.toString().equalsIgnoreCase(System.getProperty(PLATFORM_LOG_DISABLE_PROP_KEY));
/*Disable log4j bridge to commons logging.*/
String LOG4J_COMMONS_LOGGING_PLATFORM_LOG_DISABLE_PROP_KEY = "log4j.commons.logging.platform.log.disable";
boolean LOG4J_COMMONS_LOGGING_PLATFORM_LOG_DISABLE = Boolean.TRUE.toString()
.equalsIgnoreCase(System.getProperty(LOG4J_COMMONS_LOGGING_PLATFORM_LOG_DISABLE_PROP_KEY));
/*Disable log4j space factory.*/
String LOG4J_PLATFORM_LOG_DISABLE_PROP_KEY = "log4j.platform.log.disable";
boolean LOG4J_PLATFORM_LOG_DISABLE =
Boolean.TRUE.toString().equalsIgnoreCase(System.getProperty(LOG4J_PLATFORM_LOG_DISABLE_PROP_KEY));
/*Disable log4j2 space factory.*/
String LOG4J2_PLATFORM_LOG_DISABLE_PROP_KEY = "log4j2.platform.log.disable";
boolean LOG4J2_PLATFORM_LOG_DISABLE =
Boolean.TRUE.toString().equalsIgnoreCase(System.getProperty(LOG4J2_PLATFORM_LOG_DISABLE_PROP_KEY));
/*Disable logback space factory*/
String LOGBACK_PLATFORM_LOG_DISABLE_PROP_KEY = "logback.platform.log.disable";
boolean LOGBACK_PLATFORM_LOG_DISABLE =
Boolean.TRUE.toString().equalsIgnoreCase(System.getProperty(LOGBACK_PLATFORM_LOG_DISABLE_PROP_KEY));
String UTF8_STR = StandardCharsets.UTF_8.name();
/*Default log path.*/
String LOGGING_PATH_DEFAULT = System.getProperty("user.home") + File.separator + "logs";
/*Default priority, Larger numbers indicate higher priority.*/
int DEFAULT_PRIORITY = 0;
String PROCESS_MARKER = "PID";
// config prefix
String PLATFORM_CONFIG_PREFIX = "platform.log.";
// global switch to log on console
String PLATFORM_ALL_LOG_CONSOLE_SWITCH = "platform.log.console";
// single space switch to log on console
String PLATFORM_SINGLE_LOG_CONSOLE_SWITCH = "platform.log.%s.console";
// console string
String CONSOLE_SUFFIX = ".console";
/*Platform's own log switchs.*/
// internal log level config.
String LOG_INTERNAL_LEVEL = "log.internal.level";
// global console log level
String PLATFORM_ALL_LOG_CONSOLE_LEVEL = "platform.log.console.level";
// single space console log level
String PLATFORM_SINGLE_LOG_CONSOLE_LEVEL = "platform.log.%s.console.level";
// logback log pattern on console
String PLATFORM_LOG_CONSOLE_LOGBACK_PATTERN = "platform.log.console.logback.pattern";
// log4j2 log pattern on console
String PLATFORM_LOG_CONSOLE_LOG4J2_PATTERN = "platform.log.console.log4j2.pattern";
// default logback log pattern
String PLATFORM_LOG_CONSOLE_LOGBACK_PATTERN_DEFAULT =
"%d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${PID:- } --- [%15.15t] %-40.40logger{39} : %m%n";
// default log4j2 log pattern
String PLATFORM_LOG_CONSOLE_LOG4J2_PATTERN_DEFAULT =
"%d{yyyy-MM-dd HH:mm:ss.SSS} %5p %X{PID} --- [%15.15t] %-40.40logger{39} : %m%n";
// logging path file
String LOGGING_CONFIG_PATH = "logging.config.%s";
// config marker
String PLATFORM_LOG_FIRST_INITIALIZE = "platform.log.first.initialize";
// PlatformCommonConfigs cache expire time
String PLATFORM_CONFIG_CACHE_EXPIRE_TIME = "platform.config.cache.expireTime";
// PlatformCommonConfigs cache max size
String PLATFORM_CONFIG_CACHE_MAX_SIZE = "platform.config.cache.maxSize";
}