org.xins.logdoc
Class LogCentral

java.lang.Object
  extended byorg.xins.logdoc.LogCentral

public final class LogCentral
extends Object

Central class for logdoc logging.

Since:
XINS 1.0.0
Version:
$Revision: 1.32 $ $Date: 2006/08/28 09:12:30 $
Author:
Ernst de Haan

Field Summary
static String DEFAULT_LOCALE
          The default locale used at start-up, if no locale is specified in a system property.
static String LOG_LOCALE_PROPERTY
          The name of the property that specifies which locale should be used.
static String LOG_STACK_TRACE_AT_MESSAGE_LEVEL
          The name of the property that specifies if the stack traces should be displayed at the message level.
 
Method Summary
static String getContext()
          Returns the current diagnostic context identifier.
static String getLocale()
          Get the locale set in this LogCentral.
static boolean isStackTraceAtMessageLevel()
          Indicates whether the stack trace should be displayed at the same level as the message.
static void setLocale(String newLocale)
          Sets the locale on all logdoc Log classes.
static void setStackTraceAtMessageLevel(boolean sameLevel)
          Sets the display of the stack trace at the same level as the message.
static void useDefaultLocale()
          Sets the locale on all logdoc Log classes to the default locale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_LOCALE_PROPERTY

public static final String LOG_LOCALE_PROPERTY
The name of the property that specifies which locale should be used.

See Also:
Constant Field Values

LOG_STACK_TRACE_AT_MESSAGE_LEVEL

public static final String LOG_STACK_TRACE_AT_MESSAGE_LEVEL
The name of the property that specifies if the stack traces should be displayed at the message level.

Since:
XINS 1.4.0
See Also:
Constant Field Values

DEFAULT_LOCALE

public static final String DEFAULT_LOCALE
The default locale used at start-up, if no locale is specified in a system property.

See Also:
Constant Field Values
Method Detail

getContext

public static String getContext()
Returns the current diagnostic context identifier.

Returns:
the current diagnostic context identifier, or null if there is none.

setLocale

public static void setLocale(String newLocale)
                      throws IllegalArgumentException,
                             UnsupportedLocaleException
Sets the locale on all logdoc Log classes.

Parameters:
newLocale - the new locale, cannot be null.
Throws:
IllegalArgumentException - if newLocale == null.
UnsupportedLocaleException - if the specified locale is not supported by all registered logdoc Log classes.

useDefaultLocale

public static void useDefaultLocale()
Sets the locale on all logdoc Log classes to the default locale.

Since:
XINS 1.3.0

getLocale

public static String getLocale()
Get the locale set in this LogCentral.

Returns:
the locale as set for java properties file (e.g. "en_US").

setStackTraceAtMessageLevel

public static void setStackTraceAtMessageLevel(boolean sameLevel)
Sets the display of the stack trace at the same level as the message.

Parameters:
sameLevel - true if the stack trace should be at the same level, false if the stack trace should be at DEBUG level.
Since:
XINS 1.4.0

isStackTraceAtMessageLevel

public static boolean isStackTraceAtMessageLevel()
Indicates whether the stack trace should be displayed at the same level as the message.

Returns:
true if the stack trace should be at the same level, false if the stack trace should be at DEBUG level.
Since:
XINS 1.4.0


See http://www.xins.org/.