Apache Commons Logging: Difference between revisions

Content deleted Content added
m Fix link to Java portal (via WP:JWB)
No edit summary
Line 7:
| released =
| latest release version = 1.2
| latest release date = {{release date|20152014|07}}
| latest preview version =
| latest preview date =
Line 17:
}}
 
'''Apache Commons Logging''' (previously known as '''Jakarta Commons Logging''', or '''JCL''') is a [[Java platform|Java]]-based [[data logging|logging]] utility and a programming model for logging and for other toolkits. It provides [[Application programming interface|API]]s, log implementations, and [[Adapter pattern|wrapper]] implementations over some other tools.<ref name=":ac">{{Cite web|url = http://commons.apache.org/proper/commons-logging/|title = commons logging|date = |accessdate = 12 February 2016|website = Apache.org|publisher = Apache|last = |first = }}</ref><ref name=":ijcliwas_2">{{Cite book|title = Integrating Jakarta Commons Logging with IBM WebSphere Application Server V5|url=http://www-01.ibm.com/support/docview.wss?uid=swg27004610&aid=1|last = Zavala|first = D.A.|last2 = Lau| first2 = Y.C.| publisher = IBM corporation|year = 2004|___location = |volume = |pages = 2}}</ref><ref name=":ac_c">{{Cite web|url = http://commons.apache.org/proper/commons-logging/guide.html|title = contents|date = |accessdate = 12 February 2016|website = Apache.org|publisher = Apache|last = |first = }}</ref>
 
== JCL logLog level ==
The following table defines the log levels and messages in JCLApache Commons Logging, in decreasing order of severity. The left column lists the log level designation in and the right column provides a brief description of each log level.
 
{| class="wikitable"
Line 46:
|}<ref name=":ac_c"/><ref name=":ajc_120">{{Cite book|title = Apache Jakarta Commons - Reusable Java Components|last = Iverson|first = W.|publisher = Pearson Education, Inc.|year = 2005|___location = Crawfordsville, Indiana, USA|volume = |pages = 120–122}}</ref>
 
== Configuration ==
Two basic abstractions, Log and LogFactory, are used in JCLApache Commons Logging.<ref name=":ac_c"/>
 
== Example ==
Sample code may look like as follows:
<source lang="Java">
Line 98:
} catch (Exception e)
{
log.fatal(e.getMessage(), e);
}
 
Line 119:
Class.forName("com.cascadetg.NonexistantClass");
} catch (Exception e)
{
log.warn("Can't find a non-existent class!");
}
 
System.out.println();
Line 155:
System.out.println();
System.out.println("Log test complete.");
 
}
}
</source><ref name=":ajc_120"/>
 
== See also ==
{{Portal|Java (programming language)|Free software}}
*[[log4j]]
Line 166 ⟶ 165:
*{{GitHub|https://github.com/apache/commons-logging/commits?author=costinm}}
 
== References ==
{{Reflist}}
 
== External links ==
*{{Official website|https://commons.apache.org/proper/commons-logging/}}