Content deleted Content added
m Typos and general fixes using AWB |
m →Example: "Nonexistant" -> "Nonexistent", "non-existent" -> "nonexistent" |
||
(23 intermediate revisions by 19 users not shown) | |||
Line 1:
{{Short description|Logging model and program}}
{{Infobox software
| name
| logo =
| screenshot =
| caption =
| developer
| released
| latest release version = 1.
| latest release date
| latest preview version =
| latest preview date =
| operating system
| repo = {{URL|https://github.com/apache/commons-logging}}
| programming language
| genre
| license
| website
}}
'''Apache Commons Logging''' (previously known as '''Jakarta Commons Logging (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 = Intergrating Jakarta Commons Logging with IBM WebSphere Application Server V5|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>▼
▲'''Apache Commons Logging''' (previously known as '''Jakarta Commons Logging'''
== JCL log level ==▼
The following table defines the log levels and messages in JCL, in decreasing order of severity. The left column lists the log level designation in Jand the right column provides a brief description of each log level.▼
▲The following table defines the log levels and messages in
{| class="wikitable"
Line 43 ⟶ 46:
| '''trace'''
| Most detailed information. Expect these to be written to logs only.
|}<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
== Configuration ==
Two basic abstractions, Log and LogFactory, are used in
== Example ==
Sample code may look like as follows:
<
package com.cascadetg.ch09;
Line 60 ⟶ 63:
{
// Note that you pass in an instance of this class to the
// log generator.
// generated by this class.
private static Log log = LogFactory.getLog(LogGenerator.class);
Line 97 ⟶ 100:
} catch (Exception e)
{
log.fatal(e.getMessage(), e);
}
Line 116 ⟶ 119:
try
{
Class.forName("com.cascadetg.
} catch (Exception e)
{
log.warn("Can't find a
}
System.out.println();
Line 154 ⟶ 157:
System.out.println();
System.out.println("Log test complete.");
}
}
</
== See also ==
{{Portal|
*[[log4j]]
*
== References ==
{{Reflist}}
== External links ==
*
{{Apache Software Foundation}}
[[Category:Apache Software Foundation|Commons Logging]]
[[Category:Free software programmed in Java (programming language)]]
[[Category:Log file formats]]
[[Category:Software using the Apache license]]
[[Category:Apache Commons|Logging]]
|