Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.1.5)

E22562-01

oracle.apps.fnd.applcore.log
Class AppsLogger

java.lang.Object
  extended by oracle.apps.fnd.applcore.log.AppsLogger

public abstract class AppsLogger
extends java.lang.Object

Fusion Application Developers can use the static methods in this class to perform logging operations from applications.


Field Summary
static java.util.logging.Level CONFIG
          Configuration Properties and Env Settings.
static java.util.logging.Level FINE
          High level logging messages.
static java.util.logging.Level FINER
          Logging messages called upon entry and/or exit from a routine.
static java.util.logging.Level FINEST
          Low level logging messages giving maximum detail.
static java.util.logging.Level INFO
          Key flow steps.
static java.lang.String RCS_ID
           
static java.util.logging.Level SEVERE
          Highest level of severity - catch-all for any errors that were not expected (by the developer) to have occurred during normal execution.
static java.util.logging.Level WARNING
          Used for internal errors that may have been raised and exceptions that were thrown, which the user may not have been notified directly of.
 
Method Summary
static AppsIncidentInfo createIncident(java.lang.Object pThis, MessageVORow pMessage, java.util.Map<java.lang.String,java.lang.Object> pMap, java.lang.Throwable pException)
          Creates an incident in ADR system for the specified seeded pMessage.
static AppsIncidentInfo createIncident(java.lang.Object pThis, java.lang.String pAppShortName, java.lang.String pMessageName, java.util.Map<java.lang.String,java.lang.Object> pMap, java.lang.Throwable pException)
          Creates an incident in ADR system for the specified combination of Application short name and message name.
static AppsIncidentInfo createIncident(java.lang.Object pThis, java.lang.String pErrorMessage, java.lang.Throwable pException)
           Note that currently this API is stub only API.
static java.util.Map<java.lang.String,java.lang.String> getEssAdrEnvironmentVars()
          Return the environment variables to be set by ESS before launching a batch process.
static boolean isEnabled(java.util.logging.Level pLevel)
          Returns whether logging or tracing is enabled for the given severity.
static boolean isEnabled(MessageVORow pMessage)
          Returns whether logging is enabled for the given seeded message.
static boolean isIncidentEnabled()
          Returns whether incident creation is enabled for the Applications system.
static void releaseAppsLogger()
          Deprecated.  
static void releaseAppsLogger(java.lang.String sessionId)
          Release the resources for the AppsLogger instances associated with the current session.
static AppsIncidentInfo write(java.lang.Object pThis, MessageVORow pMessage, java.util.Map<java.lang.String,java.lang.Object> pMap, java.lang.Throwable pException)
          Writes the specified seeded pMessage, and optionally an pException to the log.
static void write(java.lang.Object pThis, java.lang.String pString, java.util.logging.Level pLevel)
          Writes pString to the log at the given level.
static void write(java.lang.Object pThis, java.lang.Throwable pException)
          Write pException to the log.
static void write(java.lang.Object pThis, java.lang.Throwable pException, java.util.logging.Level pLevel)
          Write pException to the log at a given level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RCS_ID

public static final java.lang.String RCS_ID
See Also:
Constant Field Values

SEVERE

public static final java.util.logging.Level SEVERE
Highest level of severity - catch-all for any errors that were not expected (by the developer) to have occurred during normal execution.


WARNING

public static final java.util.logging.Level WARNING
Used for internal errors that may have been raised and exceptions that were thrown, which the user may not have been notified directly of. Example: "Networking routine XYZ could not connect; retrying."


INFO

public static final java.util.logging.Level INFO
Key flow steps.


CONFIG

public static final java.util.logging.Level CONFIG
Configuration Properties and Env Settings.


FINE

public static final java.util.logging.Level FINE
High level logging messages. Example: "User has chosen to Cancel the Purge operation."


FINER

public static final java.util.logging.Level FINER
Logging messages called upon entry and/or exit from a routine. Example: "Entering routine validateLogin."


FINEST

public static final java.util.logging.Level FINEST
Low level logging messages giving maximum detail. Example: "Copying string from buffer xyz to buffer zyx."

Method Detail

isEnabled

public static boolean isEnabled(java.util.logging.Level pLevel)
Returns whether logging or tracing is enabled for the given severity.

For performance standards compliance, this API must be called before you construct any parameter Objects to pass to any of the write*(..) APIs.

Parameters:
pLevel - severity of the message.
Returns:
true if logging is enabled for the severity, false otherwise

isIncidentEnabled

public static boolean isIncidentEnabled()
Returns whether incident creation is enabled for the Applications system.

For performance standards compliance, this API must be called before you construct any parameter Objects to pass to createIncident(Object, MessageVORow, Map, Throwable) API.

Returns:
true if incident creation is enabled for Applications system, false otherwise.

isEnabled

public static boolean isEnabled(MessageVORow pMessage)
Returns whether logging is enabled for the given seeded message.

The API first checks for loggable_alertable attribute of message. If attribute is not 'Y' then message is not loggable and API returns false. If the loggable_alertable attribute for message is set to 'Y' then the level corrosponding to the message type is compared against AppsLogger configured logging level. If the message type has higher logging level than the AppsLogger configured logging value, true is returned otherwise the API returns false.

Parameters:
pMessage - The Message to be written to the log file
Returns:
true if logging is enabled for the message, false otherwise

write

public static AppsIncidentInfo write(java.lang.Object pThis,
                                     MessageVORow pMessage,
                                     java.util.Map<java.lang.String,java.lang.Object> pMap,
                                     java.lang.Throwable pException)
Writes the specified seeded pMessage, and optionally an pException to the log. This API also supports AutoIncident creation functionality when called by Message Service.

For performance standards compliance, you must call isEnabled(Level) before constructing any parameter Objects to pass to this API.

The message will only be logged if the message type of pMessage and the module identified by pThis are loggable.

Message qualifies for auto incident creation based on following condition.

Parameters:
pThis - Object writing the message to the log; for example, this, MyClass.class. If null, module name will default to AppsLoggerHelper.MODULE_UNKNOWN.
pMessage - Message to be translated and written to the log file. If null, no log is recorded.
pMap - Map of tokens associated with the message. This parameter is optional. These are the tokens that can be passed to the Message Service to get the formated message text.
pException - Throwable, which will be converted to string and written to the log. This parameter is optional.
Returns:
An AppsIncidentInfo object if an incident was created in ADR as result of this call. If no incident was created then API returns null.

write

public static void write(java.lang.Object pThis,
                         java.lang.Throwable pException,
                         java.util.logging.Level pLevel)
Write pException to the log at a given level.

For performance standards compliance, you must call isEnabled(Level) before constructing any parameter Objects to pass to this API.

The message will be logged only if the given pLevel and the module identified by pThis are loggable.

Parameters:
pThis - Object writing the message to the log; for example, this, MyClass.class. If null, module name will default to AppsLoggerHelper.MODULE_UNKNOWN.
pException - Throwable, which will be converted to string and written to the log file. If null, no log is recorded.
pLevel - Severity of the exception message. The message will be logged only if its severity is greater than or equal to the lesser of the configured runtime log-level (AFLOG_LEVEL) and the configured OJDL log level through logging.xml. If null, no log is recorded.

write

public static void write(java.lang.Object pThis,
                         java.lang.Throwable pException)
Write pException to the log.

For performance standards compliance, you must call isEnabled(Level) before constructing any parameter Objects to pass to this API. The Level passed to isEnabled() API in this case should always be AppsLogger.SEVERE.

The message will be logged only if the module identified by pThis is loggable. The exception is logged in log file at SEVERE level.

Parameters:
pThis - Object writing the message to the log; for example, this, MyClass.class. If null, module name will default to AppsLoggerHelper.MODULE_UNKNOWN.
pException - Throwable, which will be converted to string and written to the log file. If null, no log is recorded.

write

public static void write(java.lang.Object pThis,
                         java.lang.String pString,
                         java.util.logging.Level pLevel)
Writes pString to the log at the given level.

For performance standards compliance, you must call isEnabled(Level) before constructing any parameter Objects to pass to this API.

The message will be logged only if the given pLevel and the module identified by pThis are loggable.

Parameters:
pThis - Object writing the message to the log; for example, this, MyClass.class. If null, module name will default to AppsLoggerHelper.MODULE_UNKNOWN.
pString - String to be written to the log file. If null, no log is recorded.
pLevel - Severity of the message. The message will be logged only if its severity is greater than or equal to the lesser of the configured runtime log-level (AFLOG_LEVEL) and the configured OJDL log level through logging.xml. If null, no log is recorded.

createIncident

public static AppsIncidentInfo createIncident(java.lang.Object pThis,
                                              MessageVORow pMessage,
                                              java.util.Map<java.lang.String,java.lang.Object> pMap,
                                              java.lang.Throwable pException)
Creates an incident in ADR system for the specified seeded pMessage. It also writes the message, and optionally an pException to the log.

For performance standards compliance, you must call isIncidentEnabled() before constructing any parameter Objects to pass to this API.

This API is for Fusion application developers to manually create incidents from within their application code. If the last incident created was due to the same message parameter as is passed to the API then no new incident will be created. This is done to avoid double incident creation.

Parameters:
pThis - Object creating the incident in ADR system; for example, this, MyClass.class. If null, module name will default to AppsLoggerHelper.MODULE_UNKNOWN.
pMessage - Message resulting in incident creation. This is also the message that will be translated and written to the log as part of incident creation process. If null, no incident is created and recorded.
pMap - Map of tokens associated with the message. This parameter is optional. These are the tokens that can be passed to the Message Service to get the formated message text.
pException - Throwable, which will be converted to string and written to the log. This parameter is optional.
Returns:
An AppsIncidentInfo object if an incident is created in ADR as result of this call. If no incident is created then returns null.

createIncident

public static AppsIncidentInfo createIncident(java.lang.Object pThis,
                                              java.lang.String pAppShortName,
                                              java.lang.String pMessageName,
                                              java.util.Map<java.lang.String,java.lang.Object> pMap,
                                              java.lang.Throwable pException)
Creates an incident in ADR system for the specified combination of Application short name and message name. For incident creation this combination should be a valid seeded message. It also writes the message, and optionally an pException to the log.

This API is for Fusion application developers to manually create incidents from within their application code. If the last incident created was due to the same message as specified by short application name and message name to the API then no new incident will be created. This is done to avoid double incident creation.

Parameters:
pThis - Object creating the incident in ADR system; for example, this, MyClass.class. If null, module name will default to AppsLoggerHelper.MODULE_UNKNOWN.
pAppShortname - Short name of application requesting to create incident.
pMessageName - The name of message resulting in incident creation.
pMap - Map of tokens associated with the message. This parameter is optional. These are the tokens that can be passed to the Message Service to get the formated message text.
pException - Throwable, which will be converted to string and written to the log. This parameter is optional.
Returns:
An AppsIncidentInfo object if an incident is created in ADR as result of this call. If no incident is created then returns null.

createIncident

public static AppsIncidentInfo createIncident(java.lang.Object pThis,
                                              java.lang.String pErrorMessage,
                                              java.lang.Throwable pException)
Note that currently this API is stub only API. Implementation would be provided in drop8bld5

This should only be called by the ApplSession framework when the incident needs to be created and db is not accessible.

Creates an incident in ADR system for the specified ErrorMessage. This API should be used only when database is downa nd messages can't be retrived from message dictionary tables. It also writes the message and optionally an pException to the log.

This API is for Fusion application developers to manually create incidents from within their application code when they don't have access to Database. If the last incident created was due to the same message as specified erro message to the API then no new incident will be created. This is done to avoid double incident creation.

Parameters:
pThis - Object creating the incident in ADR system; for example, this, MyClass.class. If null, module name will default to AppsLoggerHelper.MODULE_UNKNOWN.
pErrorMessage - The error message as a string resulting in incident creation. The string should be in AppShortname-MessageNum format.
pException - Throwable, which will be converted to string and written to the log. This parameter is optional.
Returns:
An AppsIncidentInfo object if an incident is created in ADR as result of this call. If no incident is created then returns null.

releaseAppsLogger

public static void releaseAppsLogger()
Deprecated. 

Release the resources for the AppsLogger instances associated with the current session.

This should only be called by the ApplSession framework when the session is about to be terminated.

See Also:
releaseAppsLogger(String sessionId)

releaseAppsLogger

public static void releaseAppsLogger(java.lang.String sessionId)
Release the resources for the AppsLogger instances associated with the current session.

This should only be called by the ApplSession framework when the session is about to be cleaned up.


getEssAdrEnvironmentVars

public static java.util.Map<java.lang.String,java.lang.String> getEssAdrEnvironmentVars()
Return the environment variables to be set by ESS before launching a batch process. In case the process is implemented in C, this vars will tell that process where the incidents should be created. The requirement is for the C incidents to be created in the same ADR as the Java incidents of the app that started the Ess C Job diag/ofm/fusionapps/<AppName>/incident If the appname is unavailabed, default to diag/ofm/fusionapps/fusionapps/incident

This should only be called by ESS.


Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.1.5)

E22562-01

Copyright © 2011 Oracle. All Rights Reserved.