|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.plumtree.remote.logging.LogFactory
The LogFactory
is the starting point for the IDK Logging API, and offers static methods to
configure logging, query configuration properties, and obtain ILogger
instances.
Method Summary | |
static java.lang.String |
getApplicationName()
Gets the logging application name initialized or configured into the IDK logging framework, or empty string if logging is not initialized. |
static ILogger |
getLogger(java.lang.String componentName,
java.lang.Class loggingClass)
Returns a logger instance associated with the named component and the given class. |
static ILogger |
getLogger(java.lang.String componentName,
java.lang.String loggingLocation)
Returns a logger instance associated with the named component and the named location. |
static void |
initialize(java.lang.String loggingApplicationName,
boolean logToNetwork)
Initializes logging with the specified logging application name and whether or not to send log messages to receivers on the network. |
static boolean |
isInitialized()
Returns true if the IDK logging framework
has been initialized either from the logging
API or from external configuration. |
static boolean |
isLoggingToNetwork()
Returns true if the IDK logging framework
is configured to send log messages to receivers
on the local network, and false if messages are only
sent to receivers on the local machine. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static ILogger getLogger(java.lang.String componentName, java.lang.Class loggingClass)
If logging is not initialized, the framework will attempt to initialize logging from the external configuration file (web.xml). If a value is found for the logging application name, the logging framework will be initialized before the logger instance is returned.
Any log messages sent to the logger before the logging framework is initialized will be discarded.
componentName
- a string identifying a category of related log messagesloggingClass
- a class instance specifying the location for this logger's messages
ILogger
instance associated with the named component and the given class
java.lang.IllegalArgumentException
- if logging is not already initialized and the underlying web configuration file has an invalid but non-empty logging application namepublic static ILogger getLogger(java.lang.String componentName, java.lang.String loggingLocation)
If logging is not initialized, the framework will attempt to initialize logging from the external configuration file (web.xml). If a value is found for the logging application name, the logging framework will be initialized before the logger instance is returned.
Any log messages sent to the logger before the logging framework is initialized will be discarded.
componentName
- a string identifying a category of related log messagesloggingLocation
- a name specifying a class or specific location for this logger's messages
ILogger
instance associated with the named component and the named location
java.lang.IllegalArgumentException
- if logging is not already initialized and the underlying web configuration file has an invalid but non-empty logging application namepublic static void initialize(java.lang.String loggingApplicationName, boolean logToNetwork) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
If an external configuration file is present (web.xml), the values set in the configuration file take priority over values passed in the parameters.
loggingApplicationName
- the identifier common to the log sender and receivers.
Must be 1-32 characters selected from ASCII alphanumerics plus period, hyphen, underscore, and space.logToNetwork
- true
if the log messages may be sent to remote receivers via the network
false
if only local receivers will get messages
java.lang.IllegalArgumentException
- if an improper value is passed for loggingApplicationName
java.lang.IllegalStateException
- if the name and network logging parameters do not match the
values previously initialized via initialize()
or from external configurationpublic static boolean isInitialized()
true
if the IDK logging framework
has been initialized either from the logging
API or from external configuration. Log messages
sent to an uninitialized logger will be discarded.
true
if initialized, whether from API or from external configurationpublic static boolean isLoggingToNetwork()
true
if the IDK logging framework
is configured to send log messages to receivers
on the local network, and false
if messages are only
sent to receivers on the local machine.
true
if the logging framework is configured to send log messages to remote receivers over the networkpublic static java.lang.String getApplicationName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright ©2010 Oracle® Corporation. All Rights Reserved.