jdk/src/java.logging/share/classes/java/util/logging/package.html
author dfuchs
Thu, 06 Apr 2017 14:38:15 +0100
changeset 44538 a603c475d649
parent 32427 c22b7e41adf3
child 45136 bd5c526bc443
permissions -rw-r--r--
8178139: Minor typo in API documentation of java.util.logging.Logger Reviewed-by: lancea
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 
30678
a8b7fd8ede97 8075284: fix up miscellaneous TM constructions
darcy
parents: 25859
diff changeset
    33
the Java&trade; 2 platform's core logging facilities.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
The central goal of the logging APIs is to support maintaining and servicing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
software at customer sites. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
There are four main target uses of the logs:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
</P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
<OL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
   <LI> <I>Problem diagnosis by end users and system administrators</I>. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
          This consists of simple logging of common problems that can be fixed 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
          or tracked locally, such as running out of resources, security failures,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
          and simple configuration errors.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
        
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
   <LI> <I>Problem diagnosis by field service engineers</I>. The logging information
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
           used by field service engineers may be considerably more complex and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
           verbose than that required by system administrators.  Typically such information
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
           will require extra logging within particular subsystems.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
   <LI> <I>Problem diagnosis by the development organization</I>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
         When a problem occurs in the field, it may be necessary to return the captured logging
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
         information to the original development team for diagnosis. This logging
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
         information may be extremely detailed and fairly inscrutable. Such information might include
24196
61c9885d76e2 8029451: Tidy warnings cleanup for java.util package; minor changes in java.nio, java.sql
yan
parents: 5551
diff changeset
    56
         detailed tracing on the internal execution of particular subsystems.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
   <LI> <I>Problem diagnosis by developers</I>. The Logging APIs may also be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
           used to help debug an application under development. This may 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
           include logging information generated by the target application
24196
61c9885d76e2 8029451: Tidy warnings cleanup for java.util package; minor changes in java.nio, java.sql
yan
parents: 5551
diff changeset
    61
           as well as logging information generated by lower-level libraries.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
           Note however that while this use is perfectly reasonable,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
           the logging APIs are not intended to replace the normal debugging 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
           and profiling tools that may already exist in the development environment. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
</OL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
24196
61c9885d76e2 8029451: Tidy warnings cleanup for java.util package; minor changes in java.nio, java.sql
yan
parents: 5551
diff changeset
    67
<p>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
The key elements of this package include:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
<UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
   <LI> <I>Logger</I>: The main entity on which applications make 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
                logging calls. A Logger object is used to log messages 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
                for a specific system or application
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
                component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
   <LI> <I>LogRecord</I>: Used to pass logging requests between the logging
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
                   framework and individual log handlers.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
   <LI> <I>Handler</I>: Exports LogRecord objects to a variety of destinations
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
                 including memory, output streams, consoles, files, and sockets.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
                 A variety of Handler subclasses exist for this purpose. Additional Handlers
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
                 may be developed by third parties and delivered on top of the core platform.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
   <LI> <I>Level</I>: Defines a set of standard logging levels that can be used
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
                      to control logging output. Programs can be configured to output logging
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
                      for some levels while ignoring output for others.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
   <LI> <I>Filter</I>: Provides fine-grained control over what gets logged,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                       beyond the control provided by log levels. The logging APIs support a general-purpose
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
                       filter mechanism that allows application code to attach arbitrary filters to 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
                       control logging output. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
                       
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
   <LI> <I>Formatter</I>: Provides support for formatting LogRecord objects. This 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
                          package includes two formatters, SimpleFormatter and 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
                          XMLFormatter, for formatting log records in plain text
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                          or XML respectively. As with Handlers, additional Formatters 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
                          may be developed by third parties.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
</UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
The Logging APIs offer both static and dynamic configuration control.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
Static control enables field service staff to set up a particular configuration and then re-launch the 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
application with the new logging settings. Dynamic control allows for updates to the 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
logging configuration within a currently running program. The APIs also allow for logging to be 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
enabled or disabled for different functional areas of the system. For example, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
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
   101
socket events or memory management.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
</P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
<h2>Null Pointers</h2>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
In general, unless otherwise noted in the javadoc, methods and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
constructors will throw NullPointerException if passed a null argument.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
The one broad exception to this rule is that the logging convenience
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
methods in the Logger class (the config, entering, exiting, fine, finer, finest, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
log, logp, logrb, severe, throwing, and warning methods)  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
will accept null values 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
for all arguments except for the initial Level argument (if any).
24196
61c9885d76e2 8029451: Tidy warnings cleanup for java.util package; minor changes in java.nio, java.sql
yan
parents: 5551
diff changeset
   113
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
<H2>Related Documentation</H2>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
For an overview of control flow, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
please refer to the 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
<a href="../../../../technotes/guides/logging/overview.html">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
Java Logging Overview</a>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
</P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
<!-- Put @see and @since tags down here. -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
@since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
</body>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
</html>