Comments (1)
中间件或二方包引入什么日志框架,并不会影响到应用的的日志打印呀
这个其实并不是绝对的,比如中间件或者二方包引入的日志框架和应用本身期望的日志实现有冲突,那么就行您说的需要额外的桥接包去完成。而且,还要告诉用户,我们中间件的日志实现是 A(绑定 A 不能改变,那么业务就只能将就我们),而你的是 B ,造成冲突的话,你需要按照我们指定的方式去解决,并且由于业务的历史原因,业务可能会存在很多 new Appender()
深度依赖 B 的情况,按照社区的桥接包是没办法解决的(社区的桥接包都是从接口层面解决的,基本是相同的类全路径对应不同的实现完成桥接)。而且在升级引入的过程中,由于没有类隔离的机制,所有的依赖均在一个 ClassLoader 加载的范围内,这种冲突(也可能是不同版本造成)会更加明显,这样就给业务用户在使用我们的中间件造成很大的困扰。相反如果中间件不依赖任何的日志实现,业务期望用什么实现打印,中间件就自动使用其日志实现去打印,对业务而言,不会在日志使用上因为中间件的引入而带入任何困扰。
“完成日志空间打印的隔离能力“
每个中间件均是独立打印,并和业务的分开,中间件之间通过独立的“日志空间”隔离开,这样就删里面有相同的包名或者 Logger Name,通过空间 Namespace 的隔离,也不用中间件之前再去协商和修改。我们不期望给业务带来任何升级或者使用的困扰,期望业务在使用的时候,能够 丝般润滑
,同样 N 个中间件同学在使用的时候,也期望大家丝般润滑
,不用再去协商改包名或者其它。
from sofa-common-tools.
Related Issues (20)
- 支持单独配置终端日志级别 HOT 4
- LogEnvUtils will cause java.util.ConcurrentModificationException
- DefaultConfigManger will cause concurrent problem
- Better logger name where there are no known logging backend provided
- Add Public Access Modifiers to ExecutingRunnable
- Local console logger support prefix match
- Why logger init logs only printed on debug level?
- LoggerSpaceFactory4LogbackBuilder#doBuild should use spaceClassloader load LogbackLoggerSpaceFactory class HOT 1
- MutiAppLoggerSpaceManager should use caller classloader default
- Tools itself logging problem HOT 1
- Support for JDK/Spring ThreadPoolExecutor logging of decayed tasks HOT 1
- getCallerClassLoader gets wrong classloader
- bug in SofaThreadPoolTaskExecutor threadPoolName setter
- XML configuration file are very redunant
- Using of SimpleDateFormat in multi-thread environment is unsafe
- Terminate the support of JDK 6
- Not support print stack when executing one runnable in different thread
- 对于三方包, 如何重定向二方包的日志输出? HOT 1
- Use dependencyManagement and properties to manage all dependencies
- Refactor the thread pool module
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sofa-common-tools.