Oracle Application Server Portal PL/SQL API Reference - 904

Package wwlog_api_admin

This package contains methods to perform administrative functions on event logs.

For more information, see
- Events, event logging, and event properties
- Using the event logging service
- Event log record
- Secured logging views

Scope:
Public
Since:
Oracle Portal 3.0.6.6.5


Exception Summary
LOG_EVENT_NOT_FOUND
The event record does not exist.
LOG_FILTER_NOT_FOUND
The log filter does not exist.
NOT_ENOUGH_PRIVILEGES
The user does not have sufficient access privileges.
UNABLE_TO_PURGE_LOG
The log cannot be purged.

Variable Summary
g_has_registry_changed
Global variable to indicate whether the log registry has changed.
 boolean

Function/Procedure Summary
add_log_event
Adds logging domain, subdomain, and action as events in the wwlog_event$ table.
 number
add_log_registry
Adds a record to the wwlog_registry$ table.
 number
get_log_info
Indicates which log table was most recently used, which log table should be used for the next log record, and if the replacement for the current log must be purged before the current log record is saved.
 
get_log_interval
Returns the minimum interval between log purges, in days.
 number
purge_log
Purges all log records from a specified log.
 
remove_log_event
Removes a record from the wwlog_event$ table.
 
remove_log_registry
Removes a record from the wwlog_registry$ table, given an ID.
 
remove_log_registry
Remove a record from the wwlog_registry$ table, given multiple parameters.
 
set_log_interval
Sets the event log purge interval, in days.
 

Exception Detail

LOG_EVENT_NOT_FOUND

LOG_EVENT_NOT_FOUND exception
The event record does not exist.

LOG_FILTER_NOT_FOUND

LOG_FILTER_NOT_FOUND exception
The log filter does not exist.

NOT_ENOUGH_PRIVILEGES

NOT_ENOUGH_PRIVILEGES exception
The user does not have sufficient access privileges.

UNABLE_TO_PURGE_LOG

UNABLE_TO_PURGE_LOG exception
The log cannot be purged.

Variable Detail

g_has_registry_changed

g_has_registry_changed boolean := null
Global variable to indicate whether the log registry has changed.

Function/Procedure Detail

add_log_event

function add_log_event(
    p_domain in varchar2,
    p_subdomain in varchar2,
    p_action in varchar2
) return number
Adds logging domain, subdomain, and action as events in the wwlog_event$ table.

Users must have at least the Any Log Edit privilege to add a log event.

Note: These values are used to provide lists of values for users populating the wwlog_registry$ table via the Oracle Portal UI, i.e. functions available under Log Registry Administration in the Services portlet (Administer tab in Oracle Portal).

Example:

    p_id := wwlog_api_admin.add_log_event
    (
       p_domain    => 'Research&Development',
       p_subdomain => 'Expenses',
       p_action    => 'view'
    );
 
Parameters:
p_domain - the name of the domain of the object for which an event is being logged
p_subdomain - the name of the subdomain of the object for which an event is being logged
p_action - the name of the action being logged
Returns:
the ID number of the logging event
Since:
Oracle Portal 3.0.6.6.5

add_log_registry

function add_log_registry(
    p_domain in varchar2,
    p_subdomain in varchar2 default '%',
    p_name in varchar2 default '%',
    p_userid in varchar2 default '%',
    p_action in varchar2 default '%',
    p_http_user_agent in varchar2 default '%',
    p_language in varchar2 default '%'
) return number
Adds a record to the wwlog_registry$ table.

Call this function to add a record to the wwlog_registry$ table. The wwlog_registry$ table controls which logging calls are saved to the database.

Each time a call is made to a wwlog_api.log procedure, the new log record's values are compared to the records in the wwlog_registry$ table. If the comparison returns at least one record from the registry table, then a new log record is added to the database activity log.

Note: You can also add a record to the wwlog_registry$ table by clicking Log Registry Administration in the Services portlet (Administer tab in Oracle Portal).

Example:

    p_id := wwlog_api_admin.add_log_registry
    (
       p_domain        => 'Research&Development',
       p_subdomain     => 'Expenses',
       p_name          => '%',
       p_action        => 'view',
       p_userid        => '%',
       p_http_user_agent => '%',
       p_language      => '%'
    );
 
Parameters:
p_domain - the domain name for the object being logged
p_subdomain - the subdomain name of the object being logged
p_name - the name of the object being logged
p_userid - the user ID of user executing the action
p_action - the name of the action being logged
p_http_user_agent - the type of the browser being used
p_language - the language associated with logged event
Returns:
the ID of the logging filter record
Since:
Oracle Portal 3.0.6.6.5

get_log_info

procedure get_log_info(
    p_current_log in out number,
    p_new_log out number
) 
Indicates which log table was most recently used, which log table should be used for the next log record, and if the replacement for the current log must be purged before the current log record is saved.

Call this procedure to determine which of the two Oracle Portal log tables is being used:
- A value of 1 represents wwlog_activity_log1$.
- A value of 2 represents wwlog_activity_log2$.

The two values returned are passed into two number variables passed as parameters. If the two values are not the same, then the log indicated by p_new_log must be purged before a new log record is written to it.

Example:

    wwlog_api_admin.get_log_info
    (
       p_current_log => l_current_log,
       p_new_log => l_new_log
    );
 
Parameters:
p_current_log - returns a value that indicates the transaction log that is currently being written to
p_new_log - returns a value that indicates the transaction log that should be used next
Since:
Oracle Portal 3.0.6.6.5

get_log_interval

function get_log_interval
return number
Returns the minimum interval between log purges, in days.

Note: Log purges may not occur at the exact interval returned, but they will not occur more frequently than the interval returned.

Example:

    interval := wwlog_api_admin.get_log_interval;
 
Returns:
the minimum number of days between log purges
Since:
Oracle Portal 3.0.6.6.5

purge_log

procedure purge_log(
    p_current_log in number
) 
Purges all log records from a specified log.

This function removes ALL log records from the specified table. A user must have at least the ANY LOG EDIT privilege to call this procedure.

Example:

    wwlog_api_admin.purge_log
    (
      p_current_log => 1
    );
 
Parameters:
p_current_log - indicates which log will be purged Pass '1' to purge all log records in wwlog_activity_log1$ Pass '2' to purge all log records in wwlog_activity_log2$
Exceptions:
NOT_ENOUGH_PRIVILEGES - if user has insufficient privileges, i.e ADMIN.PurgeLog privileges
Since:
Oracle Portal 3.0.6.6.5

remove_log_event

procedure remove_log_event(
    p_domain in varchar2,
    p_subdomain in varchar2,
    p_action in varchar2
) 
Removes a record from the wwlog_event$ table.

Users must have at least the Any Log Edit privilege to remove a log event.

Example:

    wwlog_api_admin.remove_log_event
    (
    p_domain       => 'Research&Development',
    p_subdomain    => 'Expenses',
    p_action       => 'view'
    );
 
Parameters:
p_domain - the name of the domain that contains record to be removed
p_subdomain - the name of the subdomain of the record to be removed
p_action - the name of the action performed
Exceptions:
LOG_EVENT_NOT_FOUND - if no matching log event record is found
Since:
Oracle Portal 3.0.6.6.5

remove_log_registry

procedure remove_log_registry(
    p_id in number
) 
Removes a record from the wwlog_registry$ table, given an ID.

Example:

    wwlog_api_admin.remove_log_registry
    (
       p_id => 3
    );
 
Parameters:
p_id - the ID of the log filter record to be removed
Exceptions:
LOG_FILTER_NOT_FOUND - if no matching log filter record is found
Since:
Oracle Portal 3.0.6.6.5

remove_log_registry

procedure remove_log_registry(
    p_domain in varchar2,
    p_subdomain in varchar2 default '%',
    p_name in varchar2 default '%',
    p_userid in varchar2 default '%',
    p_action in varchar2 default '%',
    p_http_user_agent in varchar2 default '%',
    p_language in varchar2 default '%'
) 
Remove a record from the wwlog_registry$ table, given multiple parameters.

Example:

    wwlog_api_admin.remove_log_registry
   (
       p_domain => 'Research&Development',
       p_subdomain => 'Expenses',
       p_name => '%',
       p_action => 'view',
       p_userid => '%',
       p_http_user_agent => '%',
       p_language => '%'
   );
 
Parameters:
p_domain - the domain name for object being logged
p_subdomain - the subdomain name for object being logged
p_name - the name of object being logged
p_userid - the user ID for user executing the action
p_action - the name of the action being logged
p_http_user_agent - the type for the browser being used
p_language - the language associated with logged event
Since:
Oracle Portal 3.0.6.6.5

set_log_interval

procedure set_log_interval(
    p_interval in integer
) 
Sets the event log purge interval, in days.

Call this procedure to set the event log purge interval in days. Users must have at least the Any Log - Edit privilege to set a log interval.

Note: If the last log switch happened on 01-JAN-2000, and if the set interval = 21, then the first time that a log call is made when 01-JAN-2000 + 21 (22-JAN-2000) is earlier than the current date, the new destination log is purged and the log switch is performed.

Example:

    wwlog_api_admin.set_log_interval
    (
       p_interval => 21
    );
 
Parameters:
p_interval - the number of days between event log purges
Exceptions:
NOT_ENOUGH_PRIVILEGES - if a user attempting to use this procedure has insufficient privileges
Since:
Oracle Portal 3.0.6.6.5

Oracle Application Server Portal PL/SQL API Reference - 904