|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.logging.Logger com.sun.identity.log.Logger
public class Logger
OpenSSO extension to the jdk1.4 Logger
This extension gives some functionality required by
OpenSSO secure logger.
For JDK1.4
Logger please refer to
http://java.sun.com/j2se/1.4.1/docs/api/java/util/logging/Logger.html
Field Summary | |
---|---|
protected static boolean |
resolveHostName
|
static com.sun.identity.common.ReaderWriterLock |
rwLock
Lock to prevent parallel writing and reading at the same time. |
static ThreadLocal |
token
|
Constructor Summary | |
---|---|
protected |
Logger(String name,
String resourceBundleName)
Protected method to construct a logger for a named subsystem. |
Method Summary | |
---|---|
void |
flush()
Writes all the buffered log records. |
String |
getCurrentFile()
Returns the current file to which the logger's handler is writing. |
static Logger |
getLogger(String name)
Find or create a logger for a named subsystem. |
static Logger |
getLogger(String name,
String rbName)
Find or create a logger for a named subsystem. |
void |
log(LogRecord record)
Directs every log call to log(LogRecord, Object)
And thus the default authorization check does not allow logging
when an application uses this interface. |
void |
log(LogRecord record,
Object cred)
Calls super.log after checking authorization. |
static boolean |
resolveHostNameEnabled()
Return whether resolve host name is enabled |
void |
setCurrentFile(String fileName)
Set the current file to which the logger's handler is writing. |
Field Detail |
---|
public static ThreadLocal token
protected static boolean resolveHostName
public static com.sun.identity.common.ReaderWriterLock rwLock
Constructor Detail |
---|
protected Logger(String name, String resourceBundleName)
The logger will be initially configured with a null Level and with useParentHandlers true.
name
- A name for the logger. This should be a
dot-separated name and should normally be based on the
package name or class name of the subsystem, such as java.net
or javax.swing. It may be null for anonymous Loggers.resourceBundleName
- Name of the ResourceBundle to be used for
localizing messages for this logger. May be null if none
of the messages require localization.
MissingResourceException
- if the ResourceBundleName is
non-null and no corresponding resource can be found.Method Detail |
---|
public void log(LogRecord record)
log(LogRecord, Object)
And thus the default authorization check does not allow logging
when an application uses this interface.
log
in class Logger
record
- The LogRecord
to be logged.public void log(LogRecord record, Object cred)
record
- The LogRecord
to be logged.cred
- To prove authorization for log WRITE.
The default authorization hook checks validity of the single
sign on token which should be passed as the cred
.public void flush()
public static Logger getLogger(String name)
If a new logger is created its log level will be configured
based on the LogManager
and it will be configured NOT to
send logging output to its parent loggers Handlers. It will be
registered in the LogManager
global namespace.
name
- A name for the logger. This should be a dot-separated name
and should be the file name you want to have for your logs,
such as amSSO.access
, or audit.
Logger
.public static Logger getLogger(String name, String rbName)
If a new logger is created, its log level will be configured
based on the LogManager
and it will configured to also
send logging output to its parent logger's Handlers. It will be
registered in the LogManager
global namespace.
If the named Logger already exists and does not yet have a
localization resource bundle then the given resource bundle
name is used. If the named Logger already exists and has
a different resource bundle name then an
IllegalArgumentException
is thrown.
name
- A name for the logger. This should be a dot-separated name
and should be the file name you want to have for your logs, such
as amSSO.access
or audit.rbName
- A resource bundle to be used for localizing the log
messages.
public String getCurrentFile()
public void setCurrentFile(String fileName)
fileName
- name of file.public static boolean resolveHostNameEnabled()
resolveHostName
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |