Menu

Log

Barry Goodsell

Log

Package [com.oaframework.toolkit.common.util]

All of the public methods in this class (except for event()) are overloaded to provide logging from the following types of objects:

  • OAApplicationModuleImpl
  • OAViewObjectImpl
  • OAViewRowImpl
  • OAPageContext (ie: a Page Controller)

Before Logging can work correctly, the Profile Options FND: Diagnostics and FND: Debug Log Enabled must be set to Yes. The level of detail for the Log is determined by the FND: Debug Log Level Profile Option, which can take the values of one of the constants defined below. Finally, it is possible to restrict which modules produce Logging data by setting the FND: Debug Log Module Profile Option. For OA Framework this would be the class name of the class to be monitored and can include % wildcards.

In JDeveloper, it is possible to enable logging when running against the Embedded OC4J Server by adding the following parameters on the Runtime Connection page of the Project Settings:

&aflog_level=<level>&aflog_module=<module>

For example:

&aflog_level=STATEMENT&aflog_module=XXX*

Note that * is used as the wildcard when used on the URL command line, as % is a special character.

Public Constants

These constants define the various logging levels:

  • UNEXPECTED
  • ERROR
  • EXCEPTION
  • EVENT
  • PROCEDURE
  • STATEMENT
  • PERFORMANCE

isEnabled()

Returns {{Boolean|true}} if logging is enabled at the specified level for the supplied object. The method has four overloads to support different object types:

public static boolean isEnabled(OAApplicationModuleImpl am, int logLevel)
public static boolean isEnabled(OAViewObjectImpl vo, int logLevel)
public static boolean isEnabled(OAViewRowImpl vor, int logLevel)
public static boolean isEnabled(OAPageContext pc, int logLevel)

startProcedure()

If logging is enabled at PROCEDURE level for the supplied object, a message is written to the log to indicate that the current method has started. The method has four overloads to support different object types:

public static void startProcedure(OAApplicationModuleImpl am)
public static void startProcedure(OAViewObjectImpl vo)
public static void startProcedure(OAViewRowImpl vor)
public static void startProcedure(OAControllerImpl cnt, OAPageContext pc)

endProcedure()

If logging is enabled at PROCEDURE level for the supplied object, a message is written to the log to indicate that the current method has ended. The method has four overloads to support different object types:

public static void endProcedure(OAApplicationModuleImpl am)
public static void endProcedure(OAViewObjectImpl vo)
public static void endProcedure(OAViewRowImpl vor)
public static void endProcedure(OAControllerImpl cnt, OAPageContext pc)

write()

If logging is enabled at the specified level, writes the supplied message to the log. The method has four overloads to support different object types:

public static void write (OAApplicationModuleImpl am, String msg, int logLevel)
public static void write (OAViewObjectImpl vo, String msg, int logLevel)
public static void write (OAViewRowImpl vor, String msg, int logLevel)
public static void write (OAPageContext pc, String msg, int logLevel)

event()

If logging is enabled at EVENT level, writes a message to the log identifiying the current User Interface Event ([UiEvent]).

public static void event (OAPageContext pc, UiEvent evt)

Example

The following simplified example shows how the Log class can be used in a View Object, but the same principles can be applied to the other supported object types.

import com.oaframework.toolkit.util.Log;
import oracle.apps.fnd.framework.server.OAViewObjectImpl;
import oracle.jbo.domain.Number;

public class ListRecordsVOImpl extends OAViewObjectImpl
{
  public ListRecordsVOImpl()
  {
  }

  public void initQuery(Number recordId)
  {
    Log.startProcedure(this);
    Log.write(this, "RecordId = " + recordId, Log.STATEMENT);

    setWhereClauseParams(null);
    setWhereClauseParam(0, recordId);
    executeQuery();

    Log.endProcedure(this);
  }
}

Related

Wiki: UiEvent
Wiki: com.oaframework.toolkit.common.util

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.