Oracle9iAS Portal Developer Kit
A Primer on Event Logging

Oracle9iAS Portal can log events that occur during transactions with its objects.  These logs are stored in the database and are available through standard SQL calls and reporting tools. 

You can choose the events you would like to log and organize them categorically based on user-defined domains and sub-domains.  While viewing the logged events, you can view information about the event, the time the event started and stopped, the host/IP address of the remote user, the type of browser being used, and the language used when the event occurred.

Event logging services are available through the  wwlog_api packages.

Key Features

Event logging services in the Oracle9iAS Portal framework have the following key features.

Log Events

Event logs are useful to users who want to track specific usage of their portal.  To track such information, you need to create a log event.  For log events you need to define its name space.  That name space consists of:

The default domains include the Portal (WWC), Application (WWV) and Content Areas (WWS).  Each domain is further classified into sub-domains which define the object types.  The Portal domain includes Portlet, Page, Document object types; the Application domain includes Form, Menu, Report, Chart etc.; and the Content Area domain includes Folder, Item, Category, Perspective etc.  Events themselves could be of the types Add, Delete, Customize, Hide, Copy, Execute, Export etc.  If you need to define a different type of event that does not fall within these domains and sub-domains classification, define your own domain and sub-domains for your events.

Log Usage

The logs can be used to track information in two different ways:

Log Switching

Oracle9iAS Portal allows the user to set a Log Switch interval that defines how long you want to maintain your existing log records.  The log information stored in the database uses two different tables for its purpose.  The log records will be purged based on the value entered for the 'Log Switch Interval' in the Global Settings portlet.  When the log interval (stored in days) has been reached, the logging switches between the two logging tables in the database (let's call them A and B).  Logs first go into A.  When the log interval is reached the first time, the logs are now put into B.  When the log interval is reached again, the logs switch again. A is emptied in preparation to store new log records.  So if you set your log interval to 14 (the default setting), the logs will switch every 14 days, thus preserving for you, at any point of time, records dated between 14 and 28 days old.

How to Use Event Logging

The general model for working with the event logging can be described as follows:

  1. Add the event object, with an appropriate domain and sub-domain combination, using the add_log_event method.  This ensures that the LOVs and other UI components invoked when the user is monitoring the events, would show this new event in their lists.
  2. Register the log event record by using the add_log_registry_record method.  The Log Registry record represents the events you want to log in the future and provides a means to filter the events that need to be logged.
  3. Use the start_log and stop_log methods to mark the events you want to log in your code.  Alternatively for entering single-step event log information, just call the log method to mark that event.

Tips for using Event Logging

Event logging can be leveraged for your own purposes in different ways.  However to maximize your returns on using logs, keep in mind the following:

Event logging usage hints

For further details regarding implementation, refer to Implementing Event Logging.


Revision History