- Commons Logging Jar File Download
- Commons-logging-12jar Download Hd
- Commons-logging-12jar Download Windows 7
- Commons Logging Jar File
- Commons Logging 1.2
- Commons Logging 1.1.3 Jar Download
I am doing a very simple Proof of Concept of a 3rd party library (in this case, solrj).
How to install spring framework, installation of spring framework, steps spring framework tutorial, spring.jar, commons-logging.jar. But I am not able to find correct link for Spring 3.x whenever I tried to download it i think I am getting(i think) some kind of ServicePacks.Because I never found Dist folder where Generally this Jar files. Note that JCommon is being maintained but not actively developed and in the future will be dropped as a dependency for both JFreeChart and Pentaho Reporting. 28 February 2014. JCommon 1.0.22 has been released! Download; Requirements. JCommon requires JDK/JRE 1.6.0 or later.
Although I am using maven as a build system, I get the error
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
as solrj (4.10.4) doesn't define it as a dependency.
I therefore can now manually add commons logging as a maven dependency, but I am unsure which one to add:
- commons-logging-api-1.1.jar
- or commons-logging-1.2.jar
The programs runs successfully, no matter which of the two I add.
My questions:
- What is the difference between the 2 files?
- And why does commons-logging-api not exist in version 1.2?
stefan.mstefan.m
1 Answer
The commons-logging-api is just a set of interfaces to which the code (Solr in this case) is compiled, without 'locking in' to any particular logging implementation. It is unlikely to have changed at all since 1.1 so the maven vector for it remains unchanged at 1.1. But it's included with the 1.2 bundle anyway so you don't need it. All you need is:
- commons-logging:commons-logging:1.2
It's possible (likely) that some other dependency in your project is dependent on commons-logging also, hence maven will pick this up and you find that the project works either way. You can see the hierarchy of dependencies it's pulling in using:
You can also configure commons-logging to use an alternate underlying log system implementation eg. Log4J. It would be worth reading the commons-logging user guide to learn how it works and what you can do to tune it to your requirements.
Ed RandallEd Randall
Not the answer you're looking for? Browse other questions tagged javaapache-commons-logging or ask your own question.
I currently am starting a new Webapp (running on tomcat 6) I have components using slf4j and components using commons loggingI plan to use log4j 2.0 as log implementation due to several reasons (mainly for the appenders:SocketAppender and SyslogAppender but also because of the promoted config reloading without loss of log events)
Now my questions are:- To which interface do I program my new classes? loag4j or slf4j? or even commons logging?
- What's the preferred way to deploy the jars? put them in my application war or do i put them into the tomcat libs?
- what jars do I need to deploy? log4j (including slf4j and commons bindings), commons logging (slf4j-api-1.7.2.jar) and slf4j api (slf4j-api-1.7.2.jar)
raudiraudi
3 Answers
To which interface do I program my new classes? loag4j or slf4j?
If you're going to use SLF4J, program to that interface. It offers the most flexibility for underlying logging implementation. The point of slf4j is to be an interface that you can program to, so in the future if you decide to switch to, say, logback, you won't have to rewrite your code.
Commons Logging Jar File Download
What's the preferred way to deploy the jars? put them in my application war or do i put them into the tomcat libs?
Put them in your WAR.
Commons-logging-12jar Download Hd
The only reason (imo) to put JARs in the Tomcat libs directory is if they need to load a native library. Since Java won't allow you to load the same native library from two different classloaders, you need to put then in a common location. But that doesn't apply here.
Commons-logging-12jar Download Windows 7
Some people think of the lib directory as a way to save space. That may have been valid when 'server-class' machines had 1 GB of RAM, but it isn't any more. And avoiding
lib
means you avoid most of the hard-to-debug classloading issues.what jars do I need to deploy?
- slf4j-api is the basic API
- slf4j-log4j12 routes the actual logging to Log4J
- jcl-over-slf4j intercepts Commons Logging and routes it through SLF4J (to Log4J)
- log4j will be your physical logging framework
I'm assuming that you already have configuration for Log4J and/or are comfortable writing that configuration. If not, and all you care about is dealing with code that uses Log4J internally, there's
log4j-over-slf4j
, which will intercept Log4J calls. Then you need to pick a framework, such as Logback.(note: I originally added links to all of these packages, but don't have enough rep to post them. So here's a single link to the Maven repository with all of the SLF4J packages highlighted)
parsifalparsifal
I am using slf4j with log4j2 and using
if your app server has conflicting versions, you may need to override using some vendor specific classloader settings
e.g. in weblogic 12 c I have this in my weblogic.xml inside src/main/webapp/WEB-INF
Commons Logging Jar File
Kalpesh SoniKalpesh Soni
Commons Logging 1.2
Please note that I have not used Log4J 2.0, although I have used SLF4J with Log4J 1.2. With that being said, I would answer your questions as follows:
Commons Logging 1.1.3 Jar Download
- Program to SLF4J. It has a nice, simple API that is everything you will probably need from a logging framework. Plus, if you decide for some reason that you want to switch to logback or Log4J 1.2 or whatever instead of Log4J 2.0, you can just switch out the jars on the backend.
- Definitely put the jars in the application war. You should almost never put jars into the application server's
lib
directory. Otherwise, they will affect all web applications on that application server, not just yours. Furthermore, jars in the application server'slib
directory cannot be controlled by deploying webapps, but have to be managed manually. - It looks like you will need
slf4j-api-1.7.2.jar
,log4j-to-slf4j-2.0-beta4.jar
,log4j-2.0-beta4.jar
andlog4j-core-2.0-beta4.jar
, along with any dependencies. I'm sure Maven will bring in the required dependencies if you are using that.
Eric GalluzzoEric Galluzzo