Oracle9iAS Portal Developer Kit

start_log function

Contained in package wwlog_api.

Call this function to initialize a log entry and return its record ID.

Note: The elapsed time for an action being logged is the difference (to 1/100 of a second) between the time that this method is called and the time that wwlog_api.stop_log is called.

function start_log

(

p_domain in varchar2,

p_subdomain in varchar2,

p_name in varchar2,

p_action in varchar2 default null,

p_information in varchar2 default null,

p_url in varchar2 default null,

p_deferred in boolean default true,

p_key_1 in varchar2 default null,

p_key_2 in varchar2 default null,

p_key_3 in varchar2 default null,

p_key_4 in varchar2 default null,

p_key_5 in varchar2 default null

)

return integer;

Any user can use the start_log function.

Version: Oracle Portal 3.0.6.6.5 or later

Parameters:

p_domain

The domain of the object being logged.

Datatype: in varchar2

p_subdomain

The subdomain of the object being logged.

Datatype: in varchar2

p_name

The name of the instance of the object against which the event is logged.

Note: An name can be, but is not required to be, a non-translatable string value.

Datatype: in varchar2

p_action

The name of the action being performed on the object. A value for this string must be provided.

Note:This parameter is a non-translatable string value.

Datatype: in varchar2
Default: null

p_information

A comment string that can be included in the logging record.

Note: This is an optional parameter.

Datatype: in varchar2
Default: null

p_url

A URL string used to redirect the browser back to the object that was logged.

Datatype: in varchar2
Default: null

p_deferred

Indicates whether the database record should be created by the start_log, or the stop_log call.

  • Set p_deferred to TRUE if you want the logging action to insert a record into the log table only when the wwlog_api.stop_log command is called. To do this, wwlog_api.stop_log must be called with the same p_deferred value.

  • Set p_deferred to FALSE when you want the wwlog_api.start_log function to insert a log record and wwlog_api.stop_log to update the record with the elapsed time.

Datatype: boolean
Default: TRUE

p_key_1

A discretionary value for key_1.

Datatype: in varchar2
Default: null

p_key_2

A discretionary value for key_2.

Datatype: in varchar2
Default: null

p_key_3

A discretionary value for key_3.

Datatype: in varchar2
Default: null

p_key_4

A discretionary value for key_4.

Datatype: in varchar2
Default: null

p_key_5

A discretionary value for key_5.

Datatype: in varchar2
Default: null

Returns:

This function returns the ID for the log entry that it starts if p_deferred is TRUE.

Exceptions:

  • If the log cannot be purged, an UNABLE_TO_PURGE_LOG_EXCEPTION is raised.

  • If a temporary log record cannot be created, a CANNOT_CREATE_LOG_EXEPTION is raised.
  • If a log record cannot be inserted into the database, a CANNOT_INSERT_LOG_EXCEPTION is raised.

Example:

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,

p_key_1 => '1',

p_key_2 => '7334',

p_key_3 => null,

p_key_4 => null,

p_key_5 => null

);

Related topics

The PL/SQL API Reference is part of the Portal Developer Kit on Portal Studio