SOAj Core v. 1.3


info.soaj.core.util.internal
Class SjUtilLoggerJdk

java.lang.Object
  extended by info.soaj.core.util.internal.SjUtilLoggerJdk

public class SjUtilLoggerJdk
extends java.lang.Object

This utility class contains static methods for JDK logging.

Copyright (c) 2006 - 2009 by Global Technology Consulting Group, Inc. at gtcGroup.com .

Since:
v. 1.0
Author:
MarvinToll@gtcGroup.com

Field Summary
private static java.lang.String CLASS_NAME
          Class name.
 
Constructor Summary
private SjUtilLoggerJdk()
          Constructor - Private
 
Method Summary
static java.util.logging.Level configureConsoleHandler(SjPluginProperties pluginProperties, java.util.logging.Logger logger)
          This method configures a console handler and binds it to the logger.
static java.util.logging.Level configureFileHandler(SjPluginProperties pluginProperties, java.util.logging.Logger logger)
          This method configures a file handler and binds it to the logger.
static java.util.logging.Level convertToLevel(int intLevel)
           
private static void firstRowStringBuilding(java.util.logging.LogRecord logRecord, java.lang.StringBuilder sbMessage, SjNullableUserId userId)
           
static java.lang.String formatDate(long milliseconds)
          This method formats a milliseconds since 1970 into a date/time stringNotNull.
static java.lang.String formatDeclarativeLogging(java.util.logging.LogRecord logRecord, SjNullableUserId userId)
          This method formats the given log record and returns the formatted String.
static java.lang.String formatRecordLogging(java.util.logging.LogRecord logRecord, SjNullableUserId userId)
          This method formats the given log record and returns the formatted String.
static void formatStackTrace(int numberOfMessages, java.lang.String message, java.lang.String stackTraceLabel, java.lang.StringBuilder sbMessage, java.lang.Throwable thrown)
          This method formats the given stack trace and returns the formatted String.
static java.lang.String formatThrowableLogging(java.util.logging.LogRecord logRecord, SjNullableUserId userId)
          This method formats the given log record and returns the formatted String.
static java.lang.String formatTraceLogging(java.util.logging.LogRecord logRecord, SjNullableUserId userId)
          This method formats the given log record and returns the formatted String.
static java.util.logging.Logger initializeLogger(SjPluginProperties pluginProperties)
          This method initializes a logger.
private static void perConfigurationStringBuilding(java.util.logging.LogRecord logRecord, java.lang.StringBuilder sbMessage, SjNullableUserId userId)
           
private static void secondRowStringBuilding(java.util.logging.LogRecord logRecord, java.lang.StringBuilder sbMessage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_NAME

private static final java.lang.String CLASS_NAME
Class name.

Constructor Detail

SjUtilLoggerJdk

private SjUtilLoggerJdk()
Constructor - Private

Method Detail

initializeLogger

public static java.util.logging.Logger initializeLogger(SjPluginProperties pluginProperties)
This method initializes a logger. If the logger has already been initialized no further initialization occurs since additional initialization results in duplicate handlers (meaning uplicate log statements).

Parameters:
pluginProperties - The wrapper object containing the descriptor document properties associated with this plugin.
Returns:
Logger

configureConsoleHandler

public static java.util.logging.Level configureConsoleHandler(SjPluginProperties pluginProperties,
                                                              java.util.logging.Logger logger)
This method configures a console handler and binds it to the logger.

Parameters:
pluginProperties - The wrapper object containing the descriptor document properties associated with this plugin.
logger -
Returns:
Level

configureFileHandler

public static java.util.logging.Level configureFileHandler(SjPluginProperties pluginProperties,
                                                           java.util.logging.Logger logger)
This method configures a file handler and binds it to the logger.

Parameters:
pluginProperties - The wrapper object containing the descriptor document properties associated with this plugin.
logger -
Returns:
Level

convertToLevel

public static java.util.logging.Level convertToLevel(int intLevel)
Parameters:
intLevel -
Returns:
Level

formatDate

public static java.lang.String formatDate(long milliseconds)
This method formats a milliseconds since 1970 into a date/time stringNotNull.

Parameters:
milliseconds - Milliseconds since 1970.
Returns:
StringNotNull - The formatted time stringNotNull.

formatTraceLogging

public static java.lang.String formatTraceLogging(java.util.logging.LogRecord logRecord,
                                                  SjNullableUserId userId)
This method formats the given log record and returns the formatted String.

Parameters:
logRecord -
userId - The authorized user id or null.
Returns:
StringNotNull - A formatted log message.

formatDeclarativeLogging

public static java.lang.String formatDeclarativeLogging(java.util.logging.LogRecord logRecord,
                                                        SjNullableUserId userId)
This method formats the given log record and returns the formatted String.

Parameters:
logRecord -
userId - The authorized user id or null.
Returns:
StringNotNull - A formatted log message.

formatRecordLogging

public static java.lang.String formatRecordLogging(java.util.logging.LogRecord logRecord,
                                                   SjNullableUserId userId)
This method formats the given log record and returns the formatted String.

Parameters:
logRecord -
userId - The authorized user id or null.
Returns:
StringNotNull - A formatted log message.

formatThrowableLogging

public static java.lang.String formatThrowableLogging(java.util.logging.LogRecord logRecord,
                                                      SjNullableUserId userId)
This method formats the given log record and returns the formatted String.

Parameters:
logRecord - LogRecord objects are used to pass logging requests between the logging framework and individual log Handlers.
userId - The authorized user id or null.
Returns:
StringNotNull - A formatted log message.

firstRowStringBuilding

private static void firstRowStringBuilding(java.util.logging.LogRecord logRecord,
                                           java.lang.StringBuilder sbMessage,
                                           SjNullableUserId userId)
Parameters:
logRecord -
sbMessage -
userId -

secondRowStringBuilding

private static void secondRowStringBuilding(java.util.logging.LogRecord logRecord,
                                            java.lang.StringBuilder sbMessage)
Parameters:
logRecord -
sbMessage -

perConfigurationStringBuilding

private static void perConfigurationStringBuilding(java.util.logging.LogRecord logRecord,
                                                   java.lang.StringBuilder sbMessage,
                                                   SjNullableUserId userId)
Parameters:
logRecord -
sbMessage -
userId -

formatStackTrace

public static void formatStackTrace(int numberOfMessages,
                                    java.lang.String message,
                                    java.lang.String stackTraceLabel,
                                    java.lang.StringBuilder sbMessage,
                                    java.lang.Throwable thrown)
This method formats the given stack trace and returns the formatted String.

Parameters:
numberOfMessages -
message -
stackTraceLabel -
sbMessage -
thrown -

SOAj Core v. 1.3


Copyright (c) 2006 - 2009 by Global Technology Consulting Group, Inc. at gtcGroup.com.
Use is authorized, provided the source is acknowledged by inclusion of this copyright notice.