Article View: borland.public.jbuilder.java.api
Article #518Re: Using the new Logging API in java.util.logging
From: John McGrath [TeamB]
Date: Tue, 29 Jul 2003 04:21
Date: Tue, 29 Jul 2003 04:21
34 lines
2490 bytes
2490 bytes
On 7/25/2003 at 3:41:23 PM, Michael Walker wrote: > I am trying to understand the Logging API that was implemented in JDK > 1.4.x. Does anyone know how to retrieve individual LogRecords from a > specified Logger instance? Can anyone point me to some example(s) > that uses the Logging API? The Logging API is mostly a mechanism for controlling the flow of log messages, filtering and formatting them, not for persisting them. You can use it to channel the log messages in the appropriate format to the appropriate "handler", which displays or persists the log messages. Typically, you would use the Java Logging API to channel messages to something like the system event log or to a syslog port, and the log messages would be stored by those systems. You could just as easily store the logged messages into a database table. The Java Logging facility does include handlers for storing the log messages to a file, a set of rotating files, or to a socket. There are probably other handlers available somewhere, but I think that is all that is included out of the box. You might want to look at the Log4j package, which is part of the Apache Jakarta project. This performs pretty much the same function as the Java Logging API, but it is more mature and functional than the Java Logging API and it works with versions of Java prior to 1.4. It also comes with a much better selection of handlers, such as one that saves log messages to the Windows Event log. You can read about Log4j at http://jakarta.apache.org/log4j. -- Regards, John McGrath [TeamB]
Technical Details
Message-ID:
<3f25f62d$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f2187e2$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,a57820f68d033a00 X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2003-07-28 21:26:55 PST From: "John McGrath [TeamB]" <ng-b@jpmcgrath.net> Subject: Re: Using the new Logging API in java.util.logging Newsgroups: borland.public.jbuilder.java.api References: <3f2187e2$1@newsgroups.borland.com> User-Agent: XanaNews/1.15.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 NNTP-Posting-Host: 151.197.210.86 Message-ID: <3f25f62d$1@newsgroups.borland.com> Date: 28 Jul 2003 21:21:01 -0700 X-Trace: newsgroups.borland.com 1059452461 151.197.210.86 (28 Jul 2003 21:21:01 -0700) Lines: 34 X-Authenticated-User: jpmcgrath Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail