com.wm.app.tn.err
Class SystemLog2

java.lang.Object
  extended by com.wm.app.tn.err.SystemLog2

public class SystemLog2
extends java.lang.Object

Interface to Trading Networks logging. Provides a wrapper around externalized message descriptions in com.wm.app.tn.resources package, as well as methods for writing to the B2B server log and the TN Activity Log. Log messages are written with a "priority", just like B2B -- 1-9, with 1 being the highest (critical) and 9 being the lowest (debug only).


Field Summary
static int ACT_IDX
           
static int CRITICAL
          Code used to specify the severity level when logging a message.
static int DB_LOG_LEVEL
           
static int ERROR
           
static int FAC_DATABASE
           
static int FAC_DOCUMENT
           
static int FAC_EDI
           
static int FAC_GENERAL
           
static int FAC_PARTNER
           
static int FAC_QUERY
           
static int FAC_ROUTING
           
static int FAC_SECURITY
           
static int FAC_WEBMGR
           
static int INFO
           
static int LEV_IDX
           
static int MESSAGE
          Informational message level for database logging
static int MSG_IDX
          Deprecated.  
static java.lang.String[] TYPE_NAMES
          The set of message levels for database logging
static int UNKNOWN
          Unknown message level
static int WARNING
           
 
Constructor Summary
SystemLog2()
           
 
Method Summary
static java.lang.String clientFormat(int facilityCode, int minor)
          Lookup a specific message from resource bundles.
static java.lang.String clientFormat(int facilityCode, int minor, java.lang.Object arg1)
          Lookup a specific message from resource bundles.
static java.lang.String clientFormat(int facilityCode, int minor, java.lang.Object[] args)
          Lookup a specific message from resource bundles.
static java.lang.String clientFormat(int facilityCode, int minor, java.lang.Object arg1, java.lang.Object arg2)
          Lookup a specific message from resource bundles.
static java.lang.String clientFormat(int facilityCode, int minor, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
          Lookup a specific message from resource bundles.
static java.lang.String clientFormat(int facilityCode, int minor, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
          Lookup a specific message from resource bundles.
static java.lang.String clientFormat(int facilityCode, int minor, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5)
          Lookup a specific message from resource bundles.
static int dbLog(ActivityLogEntry e)
          Log a message to the system database.
static void dbLog(int type, java.lang.String brief, java.lang.String full, java.lang.String doc, java.lang.String partner)
          Log a message to the system database.
static java.lang.String doFormat(int facilityCode, int minor, boolean isServer, java.lang.Object[] args)
           
static java.lang.String format(int facilityCode, int minor)
          Deprecated. as of Trading Networks 7.1, replaced by clientFormat and serverFormat
static java.lang.String format(int facilityCode, int minor, java.lang.Object arg1)
          Deprecated. as of Trading Networks 7.1, replaced by clientFormat and serverFormat
static java.lang.String format(int facilityCode, int minor, java.lang.Object[] args)
          Deprecated. as of Trading Networks 7.1, replaced by clientFormat and serverFormat
static java.lang.String format(int facilityCode, int minor, java.lang.Object arg1, java.lang.Object arg2)
          Deprecated. as of Trading Networks 7.1, replaced by clientFormat and serverFormat
static java.lang.String format(int facilityCode, int minor, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
          Deprecated. as of Trading Networks 7.1, replaced by clientFormat and serverFormat
static java.lang.String format(int facilityCode, int minor, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
          Deprecated. as of Trading Networks 7.1, replaced by clientFormat and serverFormat
static java.lang.String format(int facilityCode, int minor, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5)
          Deprecated. as of Trading Networks 7.1, replaced by clientFormat and serverFormat
static int getDBLogLevel()
           
static java.util.Locale getDefaultLocale()
           
static java.lang.String getMessage(int facilityCode, int minor)
          Deprecated. as of Trading Networks 7.1, replaced by getMessage with three args
static java.lang.String getMessage(int facilityCode, int minor, boolean isServer)
          Returns the unformatted message text for the supplied message key.
static java.lang.String getMessage(java.lang.Throwable t)
          Returns the supplied exception's message formatted along with the class name (this helps when the message is skimpy or not there).
static java.lang.String getResource(int facilityCode, int minor)
           
static java.lang.String getStackTrace(java.lang.Throwable t)
          Returns a string representation of the stack trace of an exception.
static void init_silent()
          For internal use only
static void init(java.util.Locale loc)
          For internal use only
static void log(int severity, int facilityCode, int minor)
          Generates a journal log entry with the given severity level, facility code, and minor code.
static void log(int severity, int facilityCode, int minor, java.lang.String arg)
          Generates a journal log entry with the given severity level, facility code, minor code, and insertion argument.
static void log(int severity, int facilityCode, int minor, java.lang.String[] args)
          Generates a journal log entry with the given severity level, facility code, minor code, and insertion arguments.
static void log(int severity, int facilityCode, int minor, java.lang.String[] args, java.lang.String defaultText)
          Generates a journal log entry with the given severity level, facility code, minor code, insertion arguments, and some default text if the minor code is not found in the ResourceBundle.
static void log(int severity, java.lang.String defaultMessage)
          Generates a journal log entry with the given severity level and some default text.
static void log(int priority, java.lang.Throwable thr)
          Log an exception to the normal B2B server log.
static void logCritical(int facilityCode, int minor)
          Generates a Critical-level journal log entry with the given facility code, minor code.
static void logCritical(int facilityCode, int minor, java.lang.String arg)
          Generates a Critical-level journal log entry with the given facility code, minor code and insertion argument.
static void logCritical(int facilityCode, int minor, java.lang.String[] args)
          Generates a Critical-level journal log entry with the given facility code, minor code and insertion arguments.
static void logCritical(int facilityCode, int minor, java.lang.String[] args, java.lang.String defaultMessage)
          Generates a Critical-level journal log entry with the given facility code, minor code, insertion arguments and some default text in case the minor code is not found in the ResourceBundle.
static void logCritical(int facilityCode, int minor, java.lang.String arg1, java.lang.String arg2)
          Generates a Critical-level journal log entry with the given facility code, minor code and insertion argument.
static void logCritical(java.lang.String defaultMessage)
          Generates a Critical-level journal log entry with the given defaultMessage.
static void logCritical(java.lang.Throwable thr)
          Log an Critical-exception to the normal B2B server log.
static void logError(int facilityCode, int minor)
          Generates an Error-level journal log entry with the given facility code and minor code.
static void logError(int facilityCode, int minor, java.lang.String arg)
          Generates an Error-level journal log entry with the given facility code, minor code and insertion argument.
static void logError(int facilityCode, int minor, java.lang.String[] args)
          Generates an Error-level journal log entry with the given facility code, minor code and insertion arguments.
static void logError(int facilityCode, int minor, java.lang.String[] args, java.lang.String defaultMessage)
          Generates an Error-level journal log entry with the given facility code, minor code, insertion arguments and some default text in case the minor code is not found in the ResourceBundle.
static void logError(java.lang.String defaultMessage)
          Generates a Error-level journal log entry with the given defaultMessage.
static void logError(java.lang.Throwable thr)
          Log an Error-exception to the normal B2B server log.
static void logInfo(int facilityCode, int minor)
          Generates an informational-level journal log entry with the given facility code and minor code.
static void logInfo(int facilityCode, int minor, java.lang.String arg)
          Generates an informational-level journal log entry with the given facility code, minor code and insertion argument.
static void logInfo(int facilityCode, int minor, java.lang.String[] args)
          Generates an informational-level journal log entry with the given facility code, minor code and insertion arguments.
static void logInfo(int facilityCode, int minor, java.lang.String[] args, java.lang.String defaultMessage)
          Generates an informational-level journal log entry with the given facility code, minor code, insertion arguments and some default text in case the minor code is not found in the ResourceBundle.
static void logInfo(int facilityCode, int minor, java.lang.String arg1, java.lang.String arg2)
          Generates an informational-level journal log entry with the given facility code, minor code and insertion argument.
static void logInfo(int facilityCode, int minor, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3)
          Generates an informational-level journal log entry with the given facility code, minor code and insertion argument.
static void logInfo(java.lang.String defaultMessage)
          Generates a Info-level journal log entry with the given defaultMessage.
static void logInfo(java.lang.Throwable thr)
          Log an Info-exception to the normal B2B server log.
static void logWarning(int facilityCode, int minor)
          Generates a Warning-level journal log entry with the given facility code and minor code.
static void logWarning(int facilityCode, int minor, java.lang.String arg)
          Generates a Warning-level journal log entry with the given facility code, minor code and insertion argument.
static void logWarning(int facilityCode, int minor, java.lang.String[] args)
          Generates a Warning-level journal log entry with the given facility code, minor code and insertion arguments
static void logWarning(int facilityCode, int minor, java.lang.String[] args, java.lang.String defaultMessage)
          Generates a Warning-level journal log entry with the given facility code, minor code, insertion arguments and some default text in case the minor code is not found in the ResourceBundle.
static void logWarning(int facilityCode, int minor, java.lang.String arg1, java.lang.String arg2)
          Generates a Warning-level journal log entry with the given facility code, minor code and insertion argument.
static void logWarning(int facilityCode, int minor, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3)
          Generates a Warning-level journal log entry with the given facility code, minor code and insertion argument.
static void logWarning(java.lang.String defaultMessage)
          Generates a Warning-level journal log entry with the given defaultMessage.
static void logWarning(java.lang.Throwable thr)
          Log an Warning-exception to the normal B2B server log.
static void main(java.lang.String[] args)
          For internal use only
static java.lang.String report(int facilityCode, int minor, com.wm.data.IData pipe)
          Run a webMethods Reporter token on the supplied pipeline.
static java.lang.String serverFormat(int facilityCode, int minor)
          Lookup a specific message from resource bundles.
static java.lang.String serverFormat(int facilityCode, int minor, java.lang.Object arg1)
          Lookup a specific message from resource bundles.
static java.lang.String serverFormat(int facilityCode, int minor, java.lang.Object[] args)
          Lookup a specific message from resource bundles.
static java.lang.String serverFormat(int facilityCode, int minor, java.lang.Object arg1, java.lang.Object arg2)
          Lookup a specific message from resource bundles.
static java.lang.String serverFormat(int facilityCode, int minor, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
          Lookup a specific message from resource bundles.
static java.lang.String serverFormat(int facilityCode, int minor, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
          Lookup a specific message from resource bundles.
static java.lang.String serverFormat(int facilityCode, int minor, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5)
          Lookup a specific message from resource bundles.
static void testInit()
          For internal use only
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MESSAGE

public static final int MESSAGE
Informational message level for database logging

See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
Unknown message level

See Also:
Constant Field Values

TYPE_NAMES

public static final java.lang.String[] TYPE_NAMES
The set of message levels for database logging


CRITICAL

public static final int CRITICAL
Code used to specify the severity level when logging a message.

See Also:
Constant Field Values

ERROR

public static final int ERROR
See Also:
Constant Field Values

WARNING

public static final int WARNING
See Also:
Constant Field Values

INFO

public static final int INFO
See Also:
Constant Field Values

DB_LOG_LEVEL

public static int DB_LOG_LEVEL

FAC_DATABASE

public static final int FAC_DATABASE
See Also:
Constant Field Values

FAC_DOCUMENT

public static final int FAC_DOCUMENT
See Also:
Constant Field Values

FAC_GENERAL

public static final int FAC_GENERAL
See Also:
Constant Field Values

FAC_PARTNER

public static final int FAC_PARTNER
See Also:
Constant Field Values

FAC_QUERY

public static final int FAC_QUERY
See Also:
Constant Field Values

FAC_ROUTING

public static final int FAC_ROUTING
See Also:
Constant Field Values

FAC_SECURITY

public static final int FAC_SECURITY
See Also:
Constant Field Values

FAC_WEBMGR

public static final int FAC_WEBMGR
See Also:
Constant Field Values

FAC_EDI

public static final int FAC_EDI
See Also:
Constant Field Values

MSG_IDX

public static final int MSG_IDX
Deprecated. 
Format message added to allow EDI 6.5.2 to run on TN 7.1 Should be removed in next TN Release

See Also:
Constant Field Values

ACT_IDX

public static final int ACT_IDX
See Also:
Constant Field Values

LEV_IDX

public static final int LEV_IDX
See Also:
Constant Field Values
Constructor Detail

SystemLog2

public SystemLog2()
Method Detail

getDefaultLocale

public static java.util.Locale getDefaultLocale()

init_silent

public static void init_silent()
For internal use only


testInit

public static void testInit()
For internal use only


init

public static void init(java.util.Locale loc)
                 throws java.lang.Exception
For internal use only

Throws:
java.lang.Exception

getResource

public static java.lang.String getResource(int facilityCode,
                                           int minor)

getMessage

public static java.lang.String getMessage(int facilityCode,
                                          int minor,
                                          boolean isServer)
Returns the unformatted message text for the supplied message key. No variable substitution is performed on the message ebfore it is returned.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
isServer - A boolean: True will format the message with the default TNServer Locale.
False will attempt to format the message using the current Session's Locale. If their is no current session or Locale then the formatting will use the TNServer Locale.
Returns:
the message text. If an unknown faclity code is supplied in facilityCode, null is returned.

getMessage

public static java.lang.String getMessage(int facilityCode,
                                          int minor)
Deprecated. as of Trading Networks 7.1, replaced by getMessage with three args

See Also:
getMessage(int facilityCode, int minor, boolean isServer)

getMessage

public static java.lang.String getMessage(java.lang.Throwable t)
Returns the supplied exception's message formatted along with the class name (this helps when the message is skimpy or not there).

Parameters:
t - the exception in question
Returns:
"class: message"

getStackTrace

public static java.lang.String getStackTrace(java.lang.Throwable t)
Returns a string representation of the stack trace of an exception. Useful when you want to print the same stack trace to multiple places, or need to pass it to (for instance) other logging methods.

Parameters:
t - the exception in question
Returns:
t's stack trace

report

public static java.lang.String report(int facilityCode,
                                      int minor,
                                      com.wm.data.IData pipe)
Run a webMethods Reporter token on the supplied pipeline. This can include the regular reporter tokens, like
 %ifvar%
 
, etc.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
pipe - the inputs to the reporter
Returns:
the results of the formatting

format

public static java.lang.String format(int facilityCode,
                                      int minor)
Deprecated. as of Trading Networks 7.1, replaced by clientFormat and serverFormat

See Also:
serverFormat(int facilityCode, int minor), clientFormat(int facilityCode, int minor)

serverFormat

public static java.lang.String serverFormat(int facilityCode,
                                            int minor)
Lookup a specific message from resource bundles. The Locale used to retrieve the bundle will be the default TN server Locale. Use when formatting a message for an ActivityLog or JournalLog entry.

Parameters:
facilityCode - An int representing the facility code for the message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for the message.
This is the key used to locate the journal log text in the ResourceBundle.
Returns:
the message in question

clientFormat

public static java.lang.String clientFormat(int facilityCode,
                                            int minor)
Lookup a specific message from resource bundles. The Locale used to retrieve the bundle will be the user session Locale. A message formatted by this method is meant to be returned to a client. Use when formatting an error or warning message that is returned to a client. Use when formatting a message for an ActivityLog or JournalLog entry.

Parameters:
facilityCode - An int representing the facility code for the message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for the message.
This is the key used to locate the journal log text in the ResourceBundle.
Returns:
the message in question

format

public static java.lang.String format(int facilityCode,
                                      int minor,
                                      java.lang.Object arg1)
Deprecated. as of Trading Networks 7.1, replaced by clientFormat and serverFormat

See Also:
serverFormat(int facilityCode, int minor, Object arg1), clientFormat(int facilityCode, int minor, Object arg1)

serverFormat

public static java.lang.String serverFormat(int facilityCode,
                                            int minor,
                                            java.lang.Object arg1)
Lookup a specific message from resource bundles. The Locale used to retrieve the bundle will be the default TN server Locale. Use when formatting a message for an ActivityLog or JournalLog entry.

Parameters:
facilityCode - An int representing the facility code for the message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for the message.
This is the key used to locate the journal log text in the ResourceBundle.
arg1 - an argument to the message
Returns:
the results of the formatting

clientFormat

public static java.lang.String clientFormat(int facilityCode,
                                            int minor,
                                            java.lang.Object arg1)
Lookup a specific message from resource bundles. The Locale used to retrieve the bundle will be the user session Locale. A message formatted by this method is meant to be returned to a client. Use when formatting an error or warning message that is returned to a client. Use when formatting a message for an ActivityLog or JournalLog entry.

Parameters:
facilityCode - An int representing the facility code for the message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for the message.
This is the key used to locate the journal log text in the ResourceBundle.
arg1 - an argument to the message
Returns:
the results of the formatting

format

public static java.lang.String format(int facilityCode,
                                      int minor,
                                      java.lang.Object arg1,
                                      java.lang.Object arg2)
Deprecated. as of Trading Networks 7.1, replaced by clientFormat and serverFormat

See Also:
serverFormat(int facilityCode, int minor, Object arg1, Object arg2), clientFormat(int facilityCode, int minor, Object arg1, Object arg2)

serverFormat

public static java.lang.String serverFormat(int facilityCode,
                                            int minor,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2)
Lookup a specific message from resource bundles. The Locale used to retrieve the bundle will be the default TN server Locale. Use when formatting a message for an ActivityLog or JournalLog entry.

Parameters:
facilityCode - An int representing the facility code for the message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for the message.
This is the key used to locate the journal log text in the ResourceBundle.
arg1 - an argument to the message
arg2 - an argument to the message
Returns:
the results of the formatting

clientFormat

public static java.lang.String clientFormat(int facilityCode,
                                            int minor,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2)
Lookup a specific message from resource bundles. The Locale used to retrieve the bundle will be the user session Locale. A message formatted by this method is meant to be returned to a client. Use when formatting an error or warning message that is returned to a client. Use when formatting a message for an ActivityLog or JournalLog entry.

Parameters:
facilityCode - An int representing the facility code for the message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for the message.
This is the key used to locate the journal log text in the ResourceBundle.
arg1 - an argument to the message
arg2 - an argument to the message
Returns:
the results of the formatting

format

public static java.lang.String format(int facilityCode,
                                      int minor,
                                      java.lang.Object arg1,
                                      java.lang.Object arg2,
                                      java.lang.Object arg3)
Deprecated. as of Trading Networks 7.1, replaced by clientFormat and serverFormat

See Also:
serverFormat(int facilityCode, int minor, Object arg1, Object arg2, Object arg3), clientFormat(int facilityCode, int minor, Object arg1, Object arg2, Object arg3)

serverFormat

public static java.lang.String serverFormat(int facilityCode,
                                            int minor,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2,
                                            java.lang.Object arg3)
Lookup a specific message from resource bundles. The Locale used to retrieve the bundle will be the default TN server Locale. Use when formatting a message for an ActivityLog or JournalLog entry.

Parameters:
facilityCode - An int representing the facility code for the message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for the message.
This is the key used to locate the journal log text in the ResourceBundle.
arg1 - an argument to the message
arg2 - an argument to the message
arg3 - an argument to the message
Returns:
the results of the formatting

clientFormat

public static java.lang.String clientFormat(int facilityCode,
                                            int minor,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2,
                                            java.lang.Object arg3)
Lookup a specific message from resource bundles. The Locale used to retrieve the bundle will be the user session Locale. A message formatted by this method is meant to be returned to a client. Use when formatting an error or warning message that is returned to a client. Use when formatting a message for an ActivityLog or JournalLog entry.

Parameters:
facilityCode - An int representing the facility code for the message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for the message.
This is the key used to locate the journal log text in the ResourceBundle.
arg1 - an argument to the message
arg2 - an argument to the message
arg3 - an argument to the message
Returns:
the results of the formatting

format

public static java.lang.String format(int facilityCode,
                                      int minor,
                                      java.lang.Object arg1,
                                      java.lang.Object arg2,
                                      java.lang.Object arg3,
                                      java.lang.Object arg4)
Deprecated. as of Trading Networks 7.1, replaced by clientFormat and serverFormat

See Also:
serverFormat(int facilityCode, int minor, Object arg1, Object arg2, Object arg3, Object arg4), clientFormat(int facilityCode, int minor, Object arg1, Object arg2, Object arg3, Object arg4)

serverFormat

public static java.lang.String serverFormat(int facilityCode,
                                            int minor,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2,
                                            java.lang.Object arg3,
                                            java.lang.Object arg4)
Lookup a specific message from resource bundles. The Locale used to retrieve the bundle will be the default TN server Locale. Use when formatting a message for an ActivityLog or JournalLog entry.

Parameters:
facilityCode - An int representing the facility code for the message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for the message.
This is the key used to locate the journal log text in the ResourceBundle.
arg1 - an argument to the message
arg2 - an argument to the message
arg3 - an argument to the message
arg4 - an argument to the message
Returns:
the results of the formatting

clientFormat

public static java.lang.String clientFormat(int facilityCode,
                                            int minor,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2,
                                            java.lang.Object arg3,
                                            java.lang.Object arg4)
Lookup a specific message from resource bundles. The Locale used to retrieve the bundle will be the user session Locale. A message formatted by this method is meant to be returned to a client. Use when formatting an error or warning message that is returned to a client. Use when formatting a message for an ActivityLog or JournalLog entry.

Parameters:
facilityCode - An int representing the facility code for the message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for the message.
This is the key used to locate the journal log text in the ResourceBundle.
arg1 - an argument to the message
arg2 - an argument to the message
arg3 - an argument to the message
arg4 - an argument to the message
Returns:
the results of the formatting

format

public static java.lang.String format(int facilityCode,
                                      int minor,
                                      java.lang.Object arg1,
                                      java.lang.Object arg2,
                                      java.lang.Object arg3,
                                      java.lang.Object arg4,
                                      java.lang.Object arg5)
Deprecated. as of Trading Networks 7.1, replaced by clientFormat and serverFormat

See Also:
serverFormat(int facilityCode, int minor, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5), clientFormat(int facilityCode, int minor, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5)

serverFormat

public static java.lang.String serverFormat(int facilityCode,
                                            int minor,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2,
                                            java.lang.Object arg3,
                                            java.lang.Object arg4,
                                            java.lang.Object arg5)
Lookup a specific message from resource bundles. The Locale used to retrieve the bundle will be the default TN server Locale. Use when formatting a message for an ActivityLog or JournalLog entry.

Parameters:
facilityCode - An int representing the facility code for the message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for the message.
This is the key used to locate the journal log text in the ResourceBundle.
arg1 - an argument to the message
arg2 - an argument to the message
arg3 - an argument to the message
arg4 - an argument to the message
arg5 - an argument to the message
Returns:
the results of the formatting

clientFormat

public static java.lang.String clientFormat(int facilityCode,
                                            int minor,
                                            java.lang.Object arg1,
                                            java.lang.Object arg2,
                                            java.lang.Object arg3,
                                            java.lang.Object arg4,
                                            java.lang.Object arg5)
Lookup a specific message from resource bundles. The Locale used to retrieve the bundle will be the user session Locale. A message formatted by this method is meant to be returned to a client. Use when formatting an error or warning message that is returned to a client. Use when formatting a message for an ActivityLog or JournalLog entry.

Parameters:
facilityCode - An int representing the facility code for the message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for the message.
This is the key used to locate the journal log text in the ResourceBundle.
arg1 - an argument to the message
arg2 - an argument to the message
arg3 - an argument to the message
arg4 - an argument to the message
arg5 - an argument to the message
Returns:
the results of the formatting

format

public static java.lang.String format(int facilityCode,
                                      int minor,
                                      java.lang.Object[] args)
Deprecated. as of Trading Networks 7.1, replaced by clientFormat and serverFormat

See Also:
serverFormat(int facilityCode, int minor, Object[] args), clientFormat(int facilityCode, int minor, Object[] args)

serverFormat

public static java.lang.String serverFormat(int facilityCode,
                                            int minor,
                                            java.lang.Object[] args)
Lookup a specific message from resource bundles. The Locale used to retrieve the bundle will be the default TN server Locale. Use when formatting a message for an ActivityLog or JournalLog entry.

Parameters:
facilityCode - An int representing the facility code for the message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for the message.
This is the key used to locate the journal log text in the ResourceBundle.
args - arguments to the message (may be null)
Returns:
the results of the formatting

clientFormat

public static java.lang.String clientFormat(int facilityCode,
                                            int minor,
                                            java.lang.Object[] args)
Lookup a specific message from resource bundles. The Locale used to retrieve the bundle will be the user session Locale. A message formatted by this method is meant to be returned to a client. Use when formatting an error or warning message that is returned to a client. Use when formatting a message for an ActivityLog or JournalLog entry.

Parameters:
facilityCode - An int representing the facility code for the message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for the message.
This is the key used to locate the journal log text in the ResourceBundle.
args - arguments to the message (may be null)
Returns:
the results of the formatting

doFormat

public static java.lang.String doFormat(int facilityCode,
                                        int minor,
                                        boolean isServer,
                                        java.lang.Object[] args)

log

public static void log(int priority,
                       java.lang.Throwable thr)
Log an exception to the normal B2B server log. This will print out the supplied message, as well as the message of the supplied exception, and log the exception.

Parameters:
priority - the priority of this message
thr - the exception being logged

log

public static void log(int severity,
                       int facilityCode,
                       int minor,
                       java.lang.String[] args,
                       java.lang.String defaultText)
Generates a journal log entry with the given severity level, facility code, minor code, insertion arguments, and some default text if the minor code is not found in the ResourceBundle.

Parameters:
severity - An int representing the requested journal log level.
Should be one of the static entries from this class. For example: CRITICAL, ERROR, WARNING.
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
args - An array of Strings that will be used as insertion parameters for the journal entry.
defaultText - A String to be used as the default message if the requested minor code is not found in the ResourceBundle.

log

public static void log(int severity,
                       int facilityCode,
                       int minor,
                       java.lang.String[] args)
Generates a journal log entry with the given severity level, facility code, minor code, and insertion arguments.

Parameters:
severity - An int representing the requested journal log level.
Should be one of the static entries from this class.
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
args - An array of Strings that will be used as insertion parameters for the journal entry.

log

public static void log(int severity,
                       int facilityCode,
                       int minor,
                       java.lang.String arg)
Generates a journal log entry with the given severity level, facility code, minor code, and insertion argument.

Parameters:
severity - An int representing the requested journal log level.
Should be one of the static entries from this class.
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
arg - A String that will be used as an insertion parameter for the journal entry.

log

public static void log(int severity,
                       int facilityCode,
                       int minor)
Generates a journal log entry with the given severity level, facility code, and minor code.

Parameters:
severity - An int representing the requested journal log level.
Should be one of the static entries from this class.
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.

log

public static void log(int severity,
                       java.lang.String defaultMessage)
Generates a journal log entry with the given severity level and some default text.

Parameters:
severity - An int representing the requested journal log level.
Should be one of the static entries from this class.
defaultMessage - A String to be used as the default message if the requested minor code is not found in the ResourceBundle.

logCritical

public static void logCritical(int facilityCode,
                               int minor,
                               java.lang.String[] args,
                               java.lang.String defaultMessage)
Generates a Critical-level journal log entry with the given facility code, minor code, insertion arguments and some default text in case the minor code is not found in the ResourceBundle.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
args - An array of Strings that will be used as insertion parameters for the journal entry.
defaultMessage - A String to be used as the default message if the requested minor code is not found in the ResourceBundle.

logCritical

public static void logCritical(int facilityCode,
                               int minor,
                               java.lang.String[] args)
Generates a Critical-level journal log entry with the given facility code, minor code and insertion arguments.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
args - An array of Strings that will be used as insertion parameters for the journal entry.

logCritical

public static void logCritical(int facilityCode,
                               int minor,
                               java.lang.String arg)
Generates a Critical-level journal log entry with the given facility code, minor code and insertion argument.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
arg - A String that will be used as insertion parameters for the journal entry.

logCritical

public static void logCritical(int facilityCode,
                               int minor,
                               java.lang.String arg1,
                               java.lang.String arg2)
Generates a Critical-level journal log entry with the given facility code, minor code and insertion argument.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
arg1 - A String that will be used as insertion parameters for the journal entry.
arg2 - A String that will be used as insertion parameters for the journal entry.

logCritical

public static void logCritical(int facilityCode,
                               int minor)
Generates a Critical-level journal log entry with the given facility code, minor code.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.

logCritical

public static void logCritical(java.lang.String defaultMessage)
Generates a Critical-level journal log entry with the given defaultMessage.

Parameters:
defaultMessage - String to be used as the default message.

logCritical

public static void logCritical(java.lang.Throwable thr)
Log an Critical-exception to the normal B2B server log.

Parameters:
thr - the exception being logged

logError

public static void logError(int facilityCode,
                            int minor,
                            java.lang.String[] args,
                            java.lang.String defaultMessage)
Generates an Error-level journal log entry with the given facility code, minor code, insertion arguments and some default text in case the minor code is not found in the ResourceBundle.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
args - An array of Strings that will be used as insertion parameters for the journal entry.
defaultMessage - String to be used as the default message if the requested minor code is not found in the ResourceBundle.

logError

public static void logError(int facilityCode,
                            int minor,
                            java.lang.String[] args)
Generates an Error-level journal log entry with the given facility code, minor code and insertion arguments.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
args - An array of Strings that will be used as insertion parameters for the journal entry.

logError

public static void logError(int facilityCode,
                            int minor,
                            java.lang.String arg)
Generates an Error-level journal log entry with the given facility code, minor code and insertion argument.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
arg - A String that will be used as insertion parameters for the journal entry.

logError

public static void logError(int facilityCode,
                            int minor)
Generates an Error-level journal log entry with the given facility code and minor code.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.

logError

public static void logError(java.lang.String defaultMessage)
Generates a Error-level journal log entry with the given defaultMessage.

Parameters:
defaultMessage - String to be used as the default message.

logError

public static void logError(java.lang.Throwable thr)
Log an Error-exception to the normal B2B server log.

Parameters:
thr - the exception being logged

logWarning

public static void logWarning(int facilityCode,
                              int minor,
                              java.lang.String[] args,
                              java.lang.String defaultMessage)
Generates a Warning-level journal log entry with the given facility code, minor code, insertion arguments and some default text in case the minor code is not found in the ResourceBundle.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
args - An array of Strings that will be used as insertion parameters for the journal entry.
defaultMessage - String to be used as the default message if the requested minor code is not found in the ResourceBundle.

logWarning

public static void logWarning(int facilityCode,
                              int minor,
                              java.lang.String[] args)
Generates a Warning-level journal log entry with the given facility code, minor code and insertion arguments

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
args - An array of Strings that will be used as insertion parameters for the journal entry.

logWarning

public static void logWarning(int facilityCode,
                              int minor,
                              java.lang.String arg)
Generates a Warning-level journal log entry with the given facility code, minor code and insertion argument.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
arg - A String that will be used as an insertion parameter for the journal entry.

logWarning

public static void logWarning(int facilityCode,
                              int minor,
                              java.lang.String arg1,
                              java.lang.String arg2)
Generates a Warning-level journal log entry with the given facility code, minor code and insertion argument.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
arg1 - A String that will be used as an insertion parameter for the journal entry.
arg2 - A String that will be used as an insertion parameter for the journal entry.

logWarning

public static void logWarning(int facilityCode,
                              int minor,
                              java.lang.String arg1,
                              java.lang.String arg2,
                              java.lang.String arg3)
Generates a Warning-level journal log entry with the given facility code, minor code and insertion argument.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
arg1 - A String that will be used as an insertion parameter for the journal entry.
arg2 - A String that will be used as an insertion parameter for the journal entry.
arg3 - A String that will be used as an insertion parameter for the journal entry.

logWarning

public static void logWarning(int facilityCode,
                              int minor)
Generates a Warning-level journal log entry with the given facility code and minor code.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.

logWarning

public static void logWarning(java.lang.String defaultMessage)
Generates a Warning-level journal log entry with the given defaultMessage.

Parameters:
defaultMessage - String to be used as the default message.

logWarning

public static void logWarning(java.lang.Throwable thr)
Log an Warning-exception to the normal B2B server log.

Parameters:
thr - the exception being logged

logInfo

public static void logInfo(int facilityCode,
                           int minor,
                           java.lang.String[] args,
                           java.lang.String defaultMessage)
Generates an informational-level journal log entry with the given facility code, minor code, insertion arguments and some default text in case the minor code is not found in the ResourceBundle.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
args - An array of Strings that will be used as insertion parameters for the journal entry.
defaultMessage - String to be used as the default message if the requested minor code is not found in the ResourceBundle.

logInfo

public static void logInfo(int facilityCode,
                           int minor,
                           java.lang.String[] args)
Generates an informational-level journal log entry with the given facility code, minor code and insertion arguments.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
args - An array of Strings that will be used as insertion parameters for the journal entry.

logInfo

public static void logInfo(int facilityCode,
                           int minor,
                           java.lang.String arg)
Generates an informational-level journal log entry with the given facility code, minor code and insertion argument.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
arg - A String that will be used as an insertion parameter for the journal entry.

logInfo

public static void logInfo(int facilityCode,
                           int minor,
                           java.lang.String arg1,
                           java.lang.String arg2)
Generates an informational-level journal log entry with the given facility code, minor code and insertion argument.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
arg1 - A String that will be used as an insertion parameter for the journal entry.
arg2 - A String that will be used as an insertion parameter for the journal entry.

logInfo

public static void logInfo(int facilityCode,
                           int minor,
                           java.lang.String arg1,
                           java.lang.String arg2,
                           java.lang.String arg3)
Generates an informational-level journal log entry with the given facility code, minor code and insertion argument.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.
arg1 - A String that will be used as an insertion parameter for the journal entry.
arg2 - A String that will be used as an insertion parameter for the journal entry.
arg3 - A String that will be used as an insertion parameter for the journal entry.

logInfo

public static void logInfo(int facilityCode,
                           int minor)
Generates an informational-level journal log entry with the given facility code and minor code.

Parameters:
facilityCode - An int representing the facility code for this message.
This is the key used to locate the ResourceBundle.
minor - An int representing the minor code for this message.
This is the key used to locate the journal log text in the ResourceBundle.

logInfo

public static void logInfo(java.lang.String defaultMessage)
Generates a Info-level journal log entry with the given defaultMessage.

Parameters:
defaultMessage - String to be used as the default message.

logInfo

public static void logInfo(java.lang.Throwable thr)
Log an Info-exception to the normal B2B server log.

Parameters:
thr - the exception being logged

dbLog

public static void dbLog(int type,
                         java.lang.String brief,
                         java.lang.String full,
                         java.lang.String doc,
                         java.lang.String partner)
Log a message to the system database. This is a lot slower than logging to a file, so make sure to include plenty of interesting content.

Parameters:
type - what type of message (ERROR, WARNING or MESSAGE)
brief - a brief summary message
full - the full text of the message (can be null)
doc - related doc ID (can be null)
partner - related partner ID (can be null)

getDBLogLevel

public static int getDBLogLevel()

dbLog

public static int dbLog(ActivityLogEntry e)
Log a message to the system database. This is a lot slower than logging to a file, so make sure to include plenty of interesting content.

Parameters:
e - an activity log event
Returns:
nothing

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
For internal use only

Throws:
java.lang.Exception