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...
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...