| OracleAS Portal PL/SQL API Reference | |||||||
| FRAMES NO FRAMES | ||||||||
This topic contains the following sections relating to the wwlog_api API package:
The event logging service may be used in either of two ways to log actions performed on database objects: Start-Stop logging and Single-Step logging.
You can use a combination of wwlog_api.start_log and wwlog_api.stop_log methods to have the logging service calculate the elapsed time of a logged item.
For example, to calculate the elapsed time of an action to be performed on a page in Oracle Portal, before beginning the call to draw the page, call wwlog_api.start_log:
l_logid := wwlog_api.start_log
( p_domain => 'Research&Development',
p_subdomain => 'Expenses',
p_name => '/SE_region/Incidental/Week1',
p_action => 'view',
p_information => 'Week1 included Memorial Day picnic',
p_url => 'tools.rd_main.main?p_cornerid=772',
p_deferred => true );
In this example, the page HTML has been generated and returned to the user. Inserting the log record into a table is deferred by the use of the p_deferred = true option. After calling wwlog_api.start_log, the methods that draw the page are called. After the page is drawn, the code calls wwlog_api.stop_log.
wwlog_api.stop_log
(
p_id => l_logid,
p_row_count => 1,
p_deferred => true
);
Note: The wwlog_api.stop_log command must use the same p_deferred value as the wwlog_api.start_log command.
Use the wwlog_api.log command to create a log record by passing all of the attributes of the log to the procedure. This technique is useful for:
Logging an event that has its own way to time the event.
For example, when logging an update to an item in Oracle Portal, the code passes the necessary values to the wwlog_api.log call:
wwlog_api.log
(
p_domain => 'sbr',
p_subdomain => 'item',
p_name => '1/2332',
p_action => 'update',
p_information => 'updated author',
p_url => '/docs/folderA/whitepaper.doc'
p_row_count => 1,
p_elapsed_time => 1
);
All Oracle Portal logging routines use autonomous transactions to ensure that when an entry is saved to the transaction log, it does not modify or commit the current transaction.
Note: Autonomous transactions are methods that are called and executed independently from the main body of code.
The logging service also automatically switches between two Portal logging tables, wwlog_activity_log1$ and wwlog_activity_log2$, based on the log interval in days that is set in the global preference store for the system: Oracle.Portal.Logging.interval.
Each logged event has a corresponding record which may be retrieved with the wwlog_activity_logs view.
For details see Event Log Record.
| OracleAS Portal PL/SQL API Reference | |||||||
| FRAMES NO FRAMES | ||||||||