The version of Apache log4j used by SoundHelix.
Clone
HTTPS:
git clone https://vervis.peers.community/repos/aEp6o
SSH:
git clone USERNAME@vervis.peers.community:aEp6o
Branches
Tags
- 1.3alpha-7
- CHAINSAW_2_SANDBOX_MERGE
- CORE_VERSION
- LEVEL_REPLACES_PRIORITY
- PREALPHA_1_3_AS_OF_2004_05_12
- PRE_CHAINSAW_MODEL_CONVERSION
- PRE_UGLI_MOVE
- TAG_CHAINSAW2_MOVE
- log4j-1.2.17
- log4j-1.2.17-rc1
- v1.3alpha8
- v1.3alpha8-temp
- v1_2_1
- v1_2_10-recalled
- v1_2_11
- v1_2_11_rc1
- v1_2_11rc3
- v1_2_12
- v1_2_12_rc1
- v1_2_12_rc2
- v1_2_12_rc3
- v1_2_12_rc4
- v1_2_12_rc5
- v1_2_12_rc6
- v1_2_13
- v1_2_13_rc1
- v1_2_13_rc2
- v1_2_13_site_update
- v1_2_14
- v1_2_14_maven
- v1_2_14_rc1
- v1_2_14_site_update
- v1_2_15
- v1_2_15_rc1
- v1_2_15_rc2
- v1_2_15_rc3
- v1_2_15_rc4
- v1_2_15_rc5
- v1_2_15_rc6
- v1_2_16
- v1_2_16_rc1
- v1_2_16_rc2
- v1_2_17
- v1_2_17-rc1
- v1_2_17_rc1
- v1_2_17_rc2
- v1_2_17_rc3
- v1_2_2
- v1_2_3
- v1_2_4
- v1_2_6
- v1_2_7
- v1_2_9
- v1_2_alpha0
- v1_2_alpha7
- v1_2beta1
- v1_2final
- v1_3alpha_1
- v1_3alpha_6
- v_1_0
- v_1_0_1
- v_1_0_4
- v_1_1
- v_1_1_1
- v_1_1_2
- v_1_1_3
- v_1_1_b1
- v_1_1b2
- v_1_1b3
- v_1_1b5
- v_1_1b6
- v_1_1b7
- v_1_2beta3
v1_3alpha_6
:: docs
/
ugli.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- Content Stylesheet for Site -->
<!-- start the processing -->
<!-- ====================================================================== -->
<!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
<!-- Main Page Section -->
<!-- ====================================================================== -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<meta name="author" value="Ceki Gulcu">
<meta name="email" value="$au.getAttributeValue("email")">
<link href="./css/site.css" rel="stylesheet" type="text/css"/>
<title>Log4j project - Universal and Generic Logging Interface (UGLI) </title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#525D76">
<!-- START Header table -->
<table class="banner" border="0">
<tr>
<td valign="top">
<a href="http://logging.apache.org/">
<img src="http://logging.apache.org/images/ls-logo.jpg" border="0"/>
</a>
</td>
<td align="right">
<a href="http://logging.apache.org/log4j/docs/">
<img src="./images/logo.jpg" alt="The log4j project" border="0"/>
</a>
</td>
</tr>
</table>
<!-- END Header table -->
<div class="centercol">
<hr noshade="" size="1"/>
<h1>Universal and Generic Logging Interface (UGLI)</h1>
<p>The Universal and Generic Logging Interface or UGLI is
intended to serve as a simple abstraction of various logging
APIs allowing to plug in the desired implementation at
deployment time. Note that log4j version 1.3 and later support
UGLI directly as log4j itself is implemented in terms of the
UGLI interface.
</p>
<h2>Typical usage pattern</h2>
<pre class="source">
1: <b>import org.apache.ugli.ULogger;</b>
2: <b>import org.apache.ugli.LoggerFactory;</b>
3:
4: public class Wombat {
5:
6: <b>final ULogger logger = LoggerFactory.getLogger(Wombat.class);</b>
7: Integer t;
8: Integer oldT;
9:
10: public void setTemperature(Integer temparature) {
11:
12: oldT = t;
13: t = temperature;
14:
15: <b>logger.debug("Temperature set to {}. Old temperature was {}.", t, oldT);</b>
16:
17: if(temperature.intValue() > 50) {
18: <b>logger.info("Temperature has risen above 50 degrees".);</b>
19: }
20: }
21: }
</pre>
<p>The example above illustrates the typical usage pattern for
UGLI. Note the use of parametized log messages on line 15. See
the question <a href="http://logging.apache.org/log4j/docs/faq.html#2.3">
"What is the fastest way of (not) logging?"</a> in the log4j
FAQ for more details.
</p>
<h2>Swapping implementations at runtime</h2>
<p>UGLI currently supports four implementations, namely, NOP,
Simple, JDK 1.4 logging and log4j. Log4j 1.3 ships with four
jar files <em>ugli-nop.jar</em>, <em>ugli-simple.jar</em>,
<em>ugli-jdk14.jar</em> and <em>log4j.jar</em>. Each of these
jar files are hardwired to use just one implementation, that
is NOP, Simple, JDK 1.4 logging and log4j, respectively.
</p>
<p>Authors of widely-distributed components and librarires may
code against the UGLI interface in order to avoid imposing an
logging API implementation on the end-user. At deployment
time, the end-user may choose the desired logging API
implementation by inserting the corresponding jar file in her
classpath. This stupid, simple and relatively robust approach
avoids many of the painful bugs associated with dynamic
discovery processes based on fragile classloader hacks.
</p>
<p>Small applications where configuing log4j can be somewhat
of an overkill can drop in <em>ugli-simple.jar</em> in place
of <em>log4j.jar</em>.
</p>
<h2>Summary</h2>
<table class="ls" cellspacing="4" cellpadding="4">
<tr>
<th align="left">Advantage</th>
<th align="left">Description</th>
</tr>
<tr>
<td>Swappable logging API implementations</td>
<td>The desired logging API can be plugged in at
deployment time by insterting the appropriate jar file on
the classpath.
</td>
</tr>
<tr>
<td>Adapter implementations for the most popular APIs
</td>
<td>UGLI already supports the most popular logging APIs,
namely log4j, JDK 1.4 logging, Simple logging and NOP.
</td>
</tr>
<tr>
<td>Support for parameterized log messages</td>
<td>UGLI adapters, for all APIs and not just log4j,
support parametrized log messages.
</td>
</tr>
<tr>
<td>Built-in support</td>
<td>Log4j has built-in support for UGLI. Actually, log4j
internally makes extensive use of UGLI. The
<code>Logger</code> class in log4j directly implements
UGLI's <code>ULogger</code> interface. Moreover, all log4j
components fallback on <code>SimpleLogger</code>
implementation for log messages genereted internally by
log4j in case of incorrect configuration.
</td>
</tr>
<tr>
<td>Simplicity</td>
<td>
<p>The UGLI interfaces and their various adapters are
extremely simple. Most developers familiar with the Java
language should be able to read and fully understand the
code in less than one hour.
</p>
<p>Just as importantly, UGLI does not rely on any
classloader tricks. Every variant of
<em>ugli-<impl>.jar</em> is hardwired to use one
specific implementation.</p>
</td>
<tr>
<td>Ease of implemenation</td>
<td>The simplicity of the UGLI interfaces and the
deployment model make it easy for developers of other
logging APIs to easily conform to the UGLI model.
</td>
</tr>
</tr>
<tr>
<td>No dynamic discovery</td>
<td>Life is too short to deal with classloader
hacks.</td>
</tr>
</table>
<hr/>
<!-- FOOTER -->
<div align="center"><font color="#525D76" size="-1"><em>
Copyright © 1999-2004, Apache Software Foundation
</em></font></div>
<!-- END main table -->
<!-- LEFT SIDE NAVIGATION -->
<!-- ============================================================ -->
<div class="leftcol">
<div class="menu_header">Log4j Project</div>
<div class="menu_item"> <a href="./index.html">Introduction</a>
</div>
<div class="menu_item"> <a href="./download.html">Download</a>
</div>
<div class="menu_item"> <a href="./documentation.html">Documentation</a>
</div>
<div class="menu_item"> <a href="./chainsaw.html">Chainsaw</a>
</div>
<div class="menu_item"> <a href="./ugli.html">UGLI</a>
</div>
<div class="menu_item"> <a href="./history.html">History</a>
</div>
<div class="menu_header">Support</div>
<div class="menu_item"> <a href="http://logging.apache.org/site/binindex.cgi">Binary distributions</a>
</div>
<div class="menu_item"> <a href="http://logging.apache.org/site/cvs-repositories.html">CVS Repositories</a>
</div>
<div class="menu_item"> <a href="http://logging.apache.org/site/mailing-lists.html">Mailing Lists</a>
</div>
<div class="menu_item"> <a href="http://logging.apache.org/site/bugreport.html">Bug Reporting</a>
</div>
<div class="menu_header">Translations</div>
<div class="menu_item"> <a href="http://jakarta.apache-korea.org/log4j/index.html">Korean</a>
</div>
<div class="menu_item"> <a href="http://www.ingrid.org/jajakarta/log4j/">Japanese</a>
</div>
</div>
</body>
</html>
<!-- end the processing -->