log4j Installation - Log4j

What is log4j Installation?

log4j API package is circulated under the Apache Software License, a full-size open source license certified by the open source initiative.
The latest log4j version, as well as full-source code, class files and documentation can be found at http://logging.apache.org/log4j/.

To install log4j on your system, download apache-log4j-x.x.x.tar.gz from the specified URL and follow the steps give below.

Step 1

Unzip and untar the downloaded file in /usr/local/ directory as follows:


While untarring, it would create a directory hierarchy with a name apache-log4j-x.x.x as follows:

Step 2

  • This stage is elective and depends on what features you are working to use from log4j framework. If you previously have following packages installed on your machine then it is okay, or else you need to install them to make log4j work.
  • JavaMail API: The e-mail based logging feature in log4j requires the Java Mail API (mail.jar) to be installed on your machine from glassfish.dev.
  • JavaBeans Activation Framework: The Java Mail API will also require that the JavaBeans Activation Framework (activation.jar) be installed on your machine from http://java.sun.com/products/javabeans/jaf/index.jsp.
  • Java Message Service: The JMS-compatible features of log4j will require that both JMS and Java Naming and Directory Interface JNDI be installed on your machine from http://java.sun.com/products/jms.
  • XML Parser: You need a JAXP-compatible XML parser to use log4j. Make sure you have Xerces.jar installed on your machine from http://xerces.apache.org/xerces-j/install.html.

Step 3

Now you need to set up the CLASSPATH and PATH variables appropriately. Here we are going to set it just for the log4j.x.x.x.jar file.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Log4j Topics