工程依赖pandolet-api
,这个需要先本地执行mvn clean install
才能maven deploy成功。
- logger.api第一版本
- 支持MaxBackupIndex
- 支持按大小回滚,同时备份
- 支持自定义格式
- Logger API无缝支持国际化
- 修改ERROR CODE URL至中间件域名
- Logger API异步Appender支持配置
- Logger API支持最新版本logback 1.1.8
- 合并test用例
在使用org.slf4j.LoggerFactory.getLogger(String name)的返回值作为参数构造Slf4jLogger实例时,忽略了并发初始化日志的场景,当日志正在初始化过程中时,此时获取LoggerFactory实例为org.slf4j.helpers.SubstituteLoggerFactory,返回的logger实例将为org.slf4j.helpers.SubstituteLogger,此时不应该抛出异常,返回的logger对象亦不应缓存起来,下次等到logger初始化完成后,会返回正常logger实例。
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>tes</scope>
</dependency>
com.taobao.middleware.logger.support.LoggerHelper.getErrorCodeStr(String, String, String, String)
/**
* 根据productName获取统一格式的ErrorCode输出
*
* @param productName 如 HSF,会根据 HSF.ErrorCodeMoreUrl 从 System属性中获取 more url 前缀. 可以参考:com.taobao.middleware.logger.support.LoggerConfig.MORE_INFO_URL
* @param errorCode 错误码,如HSF-001
* @param errorType 错误类型
* @param message 出错异常信息
*/
public static String getErrorCodeStr(String productName, String errorCode, String errorType, String message) {
String moreUrl = DEFAULT_MORE_URL;
if (productName != null) {
String customUrl = System.getProperty(productName.toUpperCase() + MORE_URL_POSFIX);
if (customUrl != null) {
moreUrl = customUrl;
}
}
这个地方会拿 System 的 properties , properties 是个 hash table ,并发比较高的时候会有性能问题
默认情况下,所有的 AsyncAppender ,都是队列满了之后阻塞。统一改为队列满了丢弃。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.