Code Monkey home page Code Monkey logo

Comments (1)

guanchao-yang avatar guanchao-yang commented on July 17, 2024 2

中间件或二方包引入什么日志框架,并不会影响到应用的的日志打印呀

这个其实并不是绝对的,比如中间件或者二方包引入的日志框架和应用本身期望的日志实现有冲突,那么就行您说的需要额外的桥接包去完成。而且,还要告诉用户,我们中间件的日志实现是 A(绑定 A 不能改变,那么业务就只能将就我们),而你的是 B ,造成冲突的话,你需要按照我们指定的方式去解决,并且由于业务的历史原因,业务可能会存在很多 new Appender() 深度依赖 B 的情况,按照社区的桥接包是没办法解决的(社区的桥接包都是从接口层面解决的,基本是相同的类全路径对应不同的实现完成桥接)。而且在升级引入的过程中,由于没有类隔离的机制,所有的依赖均在一个 ClassLoader 加载的范围内,这种冲突(也可能是不同版本造成)会更加明显,这样就给业务用户在使用我们的中间件造成很大的困扰。相反如果中间件不依赖任何的日志实现,业务期望用什么实现打印,中间件就自动使用其日志实现去打印,对业务而言,不会在日志使用上因为中间件的引入而带入任何困扰。

“完成日志空间打印的隔离能力“

每个中间件均是独立打印,并和业务的分开,中间件之间通过独立的“日志空间”隔离开,这样就删里面有相同的包名或者 Logger Name,通过空间 Namespace 的隔离,也不用中间件之前再去协商和修改。我们不期望给业务带来任何升级或者使用的困扰,期望业务在使用的时候,能够 丝般润滑,同样 N 个中间件同学在使用的时候,也期望大家丝般润滑,不用再去协商改包名或者其它。

@thelight1

from sofa-common-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.