You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ce...@apache.org on 2005/01/03 16:23:13 UTC
cvs commit: logging-log4j/docs/css site.css
ceki 2005/01/03 07:23:12
Modified: docs/css site.css
Added: src/xdocs ugli.xml
docs ugli.html
Log:
Added draft documentation for UGLI.
Revision Changes Path
1.1 logging-log4j/src/xdocs/ugli.xml
Index: ugli.xml
===================================================================
<?xml version="1.0"?>
<document>
<properties>
<author>Ceki Gulcu</author>
<title>Universal and Generic Logging Interface (UGLI) </title>
</properties>
<body>
<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">
<b>import org.apache.ugli.ULogger;</b>
<b>import org.apache.ugli.LoggerFactory;</b>
public class Wombat {
<b>final ULogger logger = LoggerFactory.getLogger(Wombat.class);</b>
Integer t;
Integer oldT;
public void setTemperature(Integer temparature) {
oldT = t;
t = temperature;
<b>logger.debug("Temperature set to {}. Old temperature was {}.", t, oldT);</b>
if(temperature.intValue() > 50) {
<b>logger.info("Temperature has risen above 50 degrees".);</b>
}
}
}
</pre>
<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>Built-in support</td>
<td>Log4j has built-in support for UGLI.
</td>
</tr>
<tr>
<td>Simplicity</td>
<td>
<p>The UGLI interfaces and their various
implemenatations are extremely imple. Most developers
familiar with the Java language should be able to read
and fully understand the code in less than one hour.
</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>
</table>
</body>
</document>
1.1 logging-log4j/docs/ugli.html
Index: 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">
<b>import org.apache.ugli.ULogger;</b>
<b>import org.apache.ugli.LoggerFactory;</b>
public class Wombat {
<b>final ULogger logger = LoggerFactory.getLogger(Wombat.class);</b>
Integer t;
Integer oldT;
public void setTemperature(Integer temparature) {
oldT = t;
t = temperature;
<b>logger.debug("Temperature set to {}. Old temperature was {}.", t, oldT);</b>
if(temperature.intValue() > 50) {
<b>logger.info("Temperature has risen above 50 degrees".);</b>
}
}
}
</pre>
<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>Built-in support</td>
<td>Log4j has built-in support for UGLI.
</td>
</tr>
<tr>
<td>Simplicity</td>
<td>
<p>The UGLI interfaces and their various
implemenatations are extremely imple. Most developers
familiar with the Java language should be able to read
and fully understand the code in less than one hour.
</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>
</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="./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 -->
1.7 +2 -2 logging-log4j/docs/css/site.css
Index: site.css
===================================================================
RCS file: /home/cvs/logging-log4j/docs/css/site.css,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- site.css 17 Dec 2004 19:16:36 -0000 1.6
+++ site.css 3 Jan 2005 15:23:12 -0000 1.7
@@ -13,7 +13,7 @@
}
.centercol {
- margin-top: 100px;
+ margin-top: 120px;
margin-left: 210px;
margin-right:210px;
max-width: 800px;
@@ -30,7 +30,7 @@
position: absolute;
left: 10px;
top: 10px;
- height: 100px;
+ height: 130px;
width: 1000px;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: cvs commit: logging-log4j/docs/css site.css
Posted by Endre Stølsvik <En...@Stolsvik.com>.
On Mon, 10 Jan 2005, Ceki Gülcü wrote:
|
| No, it does not. I would prefer if log4j did not either. Furthermore, I
| also suspect that some of the other committers have changed their minds
| since the last vote on the subject.
Okay.
I really don't see why you don't want trace. It is very interesting for
development, and further interesting for debugging in production, when
some subsystem starts to act weird. The domains system is a totally
different thing, as I understand it. Lets say that I make a domain for
some "authentication" subsystem. I'd still want to be able to enter that
domain into trace mode. Or do you suggest that I make "authentication" and
"authentication.trace" domains? Wouldn't I need two loggers then? As a
comment to domains, I already use categories in this fashion. This started
out due to the possibility of us obfuscating the company's code, thus not
being able to use classnames. But it has ended up as a very nice,
hierarchical division of the server into .. domains?
Oh well. I just hope trace sticks to log4j, at least.
Endre
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: cvs commit: logging-log4j/docs/css site.css
Posted by Ceki Gülcü <ce...@qos.ch>.
No, it does not. I would prefer if log4j did not either. Furthermore, I
also suspect that some of the other committers have changed their minds
since the last vote on the subject.
At 12:50 PM 1/10/2005, Endre Stølsvik wrote:
>On Sat, 8 Jan 2005, Ceki Gülcü wrote:
>
>| Yes, thanks. Have you tried UGLI?
>
>Not yet.
>
>Does it have the trace level?! :)
>
>Endre
--
Ceki Gülcü
The complete log4j manual: http://www.qos.ch/log4j/
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: cvs commit: logging-log4j/docs/css site.css
Posted by Endre Stølsvik <En...@Stolsvik.com>.
On Sat, 8 Jan 2005, Ceki Gülcü wrote:
| Yes, thanks. Have you tried UGLI?
Not yet.
Does it have the trace level?! :)
Endre
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: cvs commit: logging-log4j/docs/css site.css
Posted by Ceki Gülcü <ce...@qos.ch>.
Yes, thanks. Have you tried UGLI?
At 01:02 PM 1/7/2005, you wrote:
>|
>| <h2>Swapping implementations at runtime</h2>
>
>"deploy time", wouldn't it be?
>
>Endre
--
Ceki Gülcü
The complete log4j manual: http://www.qos.ch/log4j/
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: cvs commit: logging-log4j/docs/css site.css
Posted by Endre Stølsvik <En...@Stolsvik.com>.
|
| <h2>Swapping implementations at runtime</h2>
"deploy time", wouldn't it be?
Endre
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org