java - 单独使用log4j 与 结合log4j&common-logging有什么区别
黄舟
黄舟 2017-04-18 10:28:51
0
2
474

单独使用log4j 与 结合log4j&common-logging有什么区别

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all (2)
阿神

common-logging is the abstraction layer of log and can be configured with different log implementations. It comes with a simple logger and can configure log4j as the log implementation.

    左手右手慢动作

    To put it simply, common-logging is just an adapter and does not implement the logging function. It only provides an abstract interface, similar to slf4j. Log4j is specifically responsible for logging.

    Of course you can use log4j alone, but if you use the more abstract common-logging, it will be very convenient if you want to switch to other log implementations (such as Logback or JDK Logger) in the future. If you use log4j alone, it will be inconvenient to switch to other logging frameworks in the future.

    For details, please refer to my other answer: https://segmentfault.com/q/10...

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!