sahan
sahan

Reputation: 41

set the way log is written using Commons-logging

Can I set the way log is written using Commons-logging instead of log4j?

I really want to use commin-logging due to the spec.

Upvotes: 1

Views: 128

Answers (2)

objects
objects

Reputation: 8677

Commons-logging is just a bridge between your application and the underlying logging system so as Joachim points out you cannot use it for configuration. Also doesn't stop you using log4j, you still need an underlying logging implementation.

Also might want to look at slf4j as discussed here http://helpdesk.objects.com.au/java/which-logging-framework

Upvotes: 0

Joachim Sauer
Joachim Sauer

Reputation: 308001

No, you can't. To quote from the documentation itself:

JCL provides only a bridge for writing log messages. It does not (and will not) support any sort of configuration API for the underlying logging system.

This is by design. The idea is to use a common logging API while being able to use any underlying log library that you want. You will still have to configure that underlying library.

Upvotes: 2

Related Questions