Skip navigation links

Oracle Application Server HTTPClient Java API Reference
10g Release 3 (10.1.3.1.0)

B32117-01


HTTPClient
Class Log

java.lang.Object
  extended byHTTPClient.Log


Deprecated. This class is deprecated, HTTPClient now uses JDK 1.4 standard logging.

public class Log
extends java.lang.Object

This is a simple logger for the HTTPClient. It defines a number of "facilities", each representing one or more logically connected classes. Logging can be enabled or disabled on a per facility basis. Furthermore, the logging output can be redirected to any desired place, such as a file or a buffer; by default all logging goes to System.err.

All log entries are preceded by the name of the currently executing thread, enclosed in {}'s, and the current time in hours, minutes, seconds, and milliseconds, enclosed in []'s. Example: {Thread-5} [20:14:03.244] Conn: Sending Request

When the class is loaded, two java system properties are read: HTTPClient.log.file and HTTPClient.log.mask. The first one, if set, causes all logging to be redirected to the file with the given name. The second one, if set, is used for setting which facilities are enabled; the value must be the bitwise OR ('|') of the values of the desired enabled facilities. E.g. a value of 3 would enable logging for the HTTPConnection and HTTPResponse, a value of 16 would enable cookie related logging, and a value of 8 would enable authorization related logging; a value of -1 would enable logging for all facilities. By default logging is disabled.

Since:
V0.3-3

Field Summary
static int ALL
          Deprecated. All the facilities - for use in setLogging (-1)
static int AUTH
          Deprecated. The Authorization facility (8)
static int CONN
          Deprecated. The HTTPConnection facility (1)
static int COOKI
          Deprecated. The Cookies facility (16)
static int DEMUX
          Deprecated. The StreamDemultiplexor facility (4)
static int MODS
          Deprecated. The Modules facility (32)
static int RESP
          Deprecated. The HTTPResponse facility (2)
static int SOCKS
          Deprecated. The Socks facility (64)
static int URLC
          Deprecated. The ULRConnection facility (128)

 

Method Summary
static boolean isEnabled(int facility)
          Deprecated.  
static void setLogging(int facilities, boolean enable)
          Deprecated.  
static void setLogWriter(java.io.Writer log, boolean closeWhenDone)
          Deprecated.  
static void write(int facility, java.lang.String msg)
          Deprecated.  
static void write(int facility, java.lang.String prefix, java.io.ByteArrayOutputStream buf)
          Deprecated.  
static void write(int facility, java.lang.String prefix, java.lang.Throwable t)
          Deprecated.  

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

CONN

public static final int CONN
Deprecated. 
The HTTPConnection facility (1)
See Also:
Constant Field Values

RESP

public static final int RESP
Deprecated. 
The HTTPResponse facility (2)
See Also:
Constant Field Values

DEMUX

public static final int DEMUX
Deprecated. 
The StreamDemultiplexor facility (4)
See Also:
Constant Field Values

AUTH

public static final int AUTH
Deprecated. 
The Authorization facility (8)
See Also:
Constant Field Values

COOKI

public static final int COOKI
Deprecated. 
The Cookies facility (16)
See Also:
Constant Field Values

MODS

public static final int MODS
Deprecated. 
The Modules facility (32)
See Also:
Constant Field Values

SOCKS

public static final int SOCKS
Deprecated. 
The Socks facility (64)
See Also:
Constant Field Values

URLC

public static final int URLC
Deprecated. 
The ULRConnection facility (128)
See Also:
Constant Field Values

ALL

public static final int ALL
Deprecated. 
All the facilities - for use in setLogging (-1)
See Also:
Constant Field Values

Method Detail

write

public static void write(int facility,
                         java.lang.String msg)
Deprecated.  
Write the given message to the current log if logging for the given facility is enabled.
Parameters:
facility - the facility which is logging the message
msg - the message to log

write

public static void write(int facility,
                         java.lang.String prefix,
                         java.lang.Throwable t)
Deprecated.  
Write the stack trace of the given exception to the current log if logging for the given facility is enabled.
Parameters:
facility - the facility which is logging the message
prefix - the string with which to prefix the stack trace; may be null
t - the exception to log

write

public static void write(int facility,
                         java.lang.String prefix,
                         java.io.ByteArrayOutputStream buf)
Deprecated.  
Write the contents of the given buffer to the current log if logging for the given facility is enabled.
Parameters:
facility - the facility which is logging the message
prefix - the string with which to prefix the buffer contents; may be null
buf - the buffer to dump

isEnabled

public static boolean isEnabled(int facility)
Deprecated.  
Check whether logging for the given facility is enabled or not.
Parameters:
facility - the facility to check
Returns:
true if logging for the given facility is enable; false otherwise

setLogging

public static void setLogging(int facilities,
                              boolean enable)
Deprecated.  
Enable or disable logging for the given facilities.
Parameters:
facilities - the facilities for which to enable or disable logging. This is bitwise OR ('|') of all the desired facilities; use ALL to affect all facilities
enable - if true, enable logging for the chosen facilities; if false, disable logging for them.

setLogWriter

public static void setLogWriter(java.io.Writer log,
                                boolean closeWhenDone)
Deprecated.  
Set the writer to which to log. By default, things are logged to System.err.
Parameters:
log - the writer to log to; if null, nothing is changed
closeWhenDone - if true, close this stream when a new stream is set again

Skip navigation links

Oracle Application Server HTTPClient Java API Reference
10g Release 3 (10.1.3.1.0)

B32117-01


Copyright © 2004, 2006, Oracle. All rights reserved.