jdk/src/share/classes/java/util/logging/package.html
author yhuang
Wed, 14 Mar 2012 23:07:21 -0700
changeset 12135 078775fa4b30
parent 5551 327690766109
child 24196 61c9885d76e2
permissions -rw-r--r--
7085757: Currency Data: ISO 4217 Amendment 152 Reviewed-by: naoto
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
<html>
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
<head>
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
<!--
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     5
Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    10
published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    12
by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
5551
327690766109 6956202: Fix a few missed rebranding issues, please contact lines etc.
ohair
parents: 5506
diff changeset
    24
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
327690766109 6956202: Fix a few missed rebranding issues, please contact lines etc.
ohair
parents: 5506
diff changeset
    25
or visit www.oracle.com if you need additional information or have any
327690766109 6956202: Fix a few missed rebranding issues, please contact lines etc.
ohair
parents: 5506
diff changeset
    26
questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
-->
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
</head>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
<body bgcolor="white">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
Provides the classes and interfaces of 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
the Java<SUP><FONT SIZE="-2">TM</FONT></SUP> 2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 platform's core logging facilities.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
The central goal of the logging APIs is to support maintaining and servicing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
software at customer sites. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
There are four main target uses of the logs:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
</P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
<OL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
   <LI> <I>Problem diagnosis by end users and system administrators</I>. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
          This consists of simple logging of common problems that can be fixed 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
          or tracked locally, such as running out of resources, security failures,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
          and simple configuration errors.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
        
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
   <LI> <I>Problem diagnosis by field service engineers</I>. The logging information
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
           used by field service engineers may be considerably more complex and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
           verbose than that required by system administrators.  Typically such information
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
           will require extra logging within particular subsystems.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
   <LI> <I>Problem diagnosis by the development organization</I>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
         When a problem occurs in the field, it may be necessary to return the captured logging
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
         information to the original development team for diagnosis. This logging
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
         information may be extremely detailed and fairly inscrutable. Such information might include
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
         detailed tracing on the internal execution of particular subsystems.           
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
   <LI> <I>Problem diagnosis by developers</I>. The Logging APIs may also be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
           used to help debug an application under development. This may 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
           include logging information generated by the target application
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
           as well as logging information generated by lower-level libraries.          
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
           Note however that while this use is perfectly reasonable,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
           the logging APIs are not intended to replace the normal debugging 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
           and profiling tools that may already exist in the development environment. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
</OL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
</P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
The key elements of this package include:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
<UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
   <LI> <I>Logger</I>: The main entity on which applications make 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
                logging calls. A Logger object is used to log messages 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
                for a specific system or application
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
                component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
   <LI> <I>LogRecord</I>: Used to pass logging requests between the logging
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
                   framework and individual log handlers.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
   <LI> <I>Handler</I>: Exports LogRecord objects to a variety of destinations
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
                 including memory, output streams, consoles, files, and sockets.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
                 A variety of Handler subclasses exist for this purpose. Additional Handlers
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
                 may be developed by third parties and delivered on top of the core platform.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
   <LI> <I>Level</I>: Defines a set of standard logging levels that can be used
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
                      to control logging output. Programs can be configured to output logging
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
                      for some levels while ignoring output for others.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
   <LI> <I>Filter</I>: Provides fine-grained control over what gets logged,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
                       beyond the control provided by log levels. The logging APIs support a general-purpose
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
                       filter mechanism that allows application code to attach arbitrary filters to 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
                       control logging output. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
                       
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
   <LI> <I>Formatter</I>: Provides support for formatting LogRecord objects. This 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
                          package includes two formatters, SimpleFormatter and 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                          XMLFormatter, for formatting log records in plain text
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
                          or XML respectively. As with Handlers, additional Formatters 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
                          may be developed by third parties.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
</UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
The Logging APIs offer both static and dynamic configuration control.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
Static control enables field service staff to set up a particular configuration and then re-launch the 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
application with the new logging settings. Dynamic control allows for updates to the 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
logging configuration within a currently running program. The APIs also allow for logging to be 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
enabled or disabled for different functional areas of the system. For example, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
a field service engineer might be interested in tracing all AWT events, but might have no interest in 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
socket events or memory management.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
</P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
<h2>Null Pointers</h2>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
In general, unless otherwise noted in the javadoc, methods and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
constructors will throw NullPointerException if passed a null argument.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
The one broad exception to this rule is that the logging convenience
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
methods in the Logger class (the config, entering, exiting, fine, finer, finest, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
log, logp, logrb, severe, throwing, and warning methods)  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
will accept null values 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
for all arguments except for the initial Level argument (if any).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
<H2>Related Documentation</H2>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
For an overview of control flow, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
please refer to the 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
<a href="../../../../technotes/guides/logging/overview.html">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
Java Logging Overview</a>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
</P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
<!-- Put @see and @since tags down here. -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
@since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
</body>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
</html>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134