Skip to Content
Log4J
book

Log4J

by J. Steven Perry
October 2009
Intermediate to advanced
74 pages
1h 58m
English
O'Reilly Media, Inc.
Content preview from Log4J

About the Example Application

This Short Cut is going to be filled with examples; lots of examples. As noted earlier, this Short Cut also comes with an Example Application (available at the code example repository), and every example in this Short Cut (except where explicitly noted) comes straight from it. That way you can go right from here to the example, see the full code and configuration, and run it. You can match up the example number from here to the build target to execute. The configuration files (log4j.properties, for example) will be copied to the PROJECT_ROOT/target/classes directory, where PROJECT_ROOT is the full path to the directory where you installed the sample code. In all examples - unless otherwise noted - the PROJECT_ROOT folder is C:\home\workspace\log4j-example on Windows and ~/workspace/log4j-example on Linux.

I have kept the Example Application simple so that you don’t spend time learning how the application works, and can focus your efforts on learning how it uses log4j (Figure 1 illustrates the Example application architecture). The application is a simple, standalone Supplier/Consumer application. One or more Supplier threads do “work” (via the WorkUnit class), place an item into a Queue, where one or more Consumer threads similarly do “work.”

Example application architecture: Through JMX a web browser is used to manage and monitor the application as it runs.

Figure 1. Example application architecture: Through JMX a web browser is used to manage and monitor the application ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Pro Apache Log4j, Second Edition

Pro Apache Log4j, Second Edition

Samudra Gupta
Tomcat: The Definitive Guide

Tomcat: The Definitive Guide

Jason Brittain, Ian F. Darwin
Introduction to JVM Languages

Introduction to JVM Languages

Ramasubramanian Sankar, Vincent van der Leun

Publisher Resources

ISBN: 9781449379735Errata