Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
Hello Program with Apache Log4j 1.x
How to write a simple Hello program with Apache Log4j 1.x? I need it to test out which JARs are needed to compile and run my Java applications using Log4j 1.x.
✍: FYIcenter.com
Below is a simple Hello program that calls the Apache Log4j 1.x API:
// Copyright (c) FYIcenter.com
import org.apache.log4j.*;
public class HelloLog4j {
private static final Logger logger = Logger.getLogger("fyiLogger");
public static void main(String[] args) {
System.out.println("Logger class: "+logger.getClass().getName());
BasicConfigurator.configure();
logger.fatal("Hello - fatal");
logger.error("Hello - error");
logger.warn("Hello - warn");
logger.info("Hello - info");
logger.debug("Hello - debug");
logger.trace("Hello - trace");
}
}
This sample program, HelloLog4j.java, does the following:
⇒ Compile and Run Program with Apache Log4j 1.x
⇐ Prerequisites for Apache Log4j 1.x
2015-12-11, ∼2360🔥, 0💬
Popular Posts:
maven-settings-builder-3 .8.6.jaris the JAR file for Apache Maven 3.8.6 Settings Builder module. Apa...
JDK 17 java.base.jmod is the JMOD file for JDK 17 Base module. JDK 17 Base module compiled class fil...
What is the jaxp\TypeInfoWriter.java provided in the Apache Xerces package? I have Apache Xerces 2.1...
Apache Commons Lang 3 is the 3rd version of Apache Commons Lang, which provides a host of helper uti...
Xalan-Java, Version 2.7.1, is an XSLT processor for transforming XML documents into HTML, text, or o...