22.8 Creating Custom Activity Reports Using APEX_ACTIVITY_LOG
Learn how to use the APEX_ACTIVITY_LOG
view to query activity for the current workspace.
- Enabling Logging for an Application
You enable logging for an application on the Edit Application Definition page. - APEX_ACTIVITY_LOG
UseAPEX_ACTIVITY_LOG
to view and query all activity for the current workspace. - APEX_ACTIVITY_LOG Sample Query
Parent topic: Managing Application Performance
22.8.1 Enabling Logging for an Application
You enable logging for an application on the Edit Application Definition page.
To edit the application definition:
Tip:
You can only modify the Logging attribute if the Application Activity Logging attribute in Oracle Application Express Administration Services is set to Use Application Setting.
See Also:
"Enabling Application Activity" in Logging in Oracle Application Express Administration Guide
Parent topic: Creating Custom Activity Reports Using APEX_ACTIVITY_LOG
22.8.2 APEX_ACTIVITY_LOG
Use APEX_ACTIVITY_LOG
to view and query all activity for the current workspace.
The APEX_ACTIVITY_LOG
view records all activity in a workspace, including developer activity and application runtime activity. You can use APEX_ACTIVITY_LOG
to view and query all activity for the current workspace. For example, you can use this view to develop monitoring reports within a specific application to provide real-time performance statistics.
Table 22-1 describes the columns in the APEX_ACTIVITY_LOG
view.
Table 22-1 Columns in APEX_ACTIVITY_LOG
Column | Type | Description |
---|---|---|
|
DATE |
Date and time that activity was logged at the end of the page view. |
|
VARCHAR2(255) |
Reserved for future use. |
|
VARCHAR2(255) |
Reserved for future use. |
|
VARCHAR2(4000) |
Title of page. |
|
VARCHAR2(4000) |
Reserved for future use. |
|
NUMBER |
Elapsed time of page view in seconds. |
|
NUMBER |
Number of rows processed on page. |
|
VARCHAR2(255) |
User ID performing page view. |
|
VARCHAR2(4000) |
IP address of client. |
|
NUMBER |
Interactive report ID |
|
VARCHAR2 |
Interactive report search criteria entered by users. |
|
VARCHAR2(4000) |
web browser user agent of client. |
|
NUMBER |
Application ID. |
|
NUMBER |
Page number. |
|
NUMBER |
Oracle Application Express session identifier. |
|
VARCHAR2(4000) |
SQL Error message. |
|
VARCHAR2(255) |
Reserved for future use. |
|
VARCHAR2(255) |
Reserved for future use. |
To conserve space in the activity log, only the first log entry of each unique session contains the IP address and web browser user agent.
Parent topic: Creating Custom Activity Reports Using APEX_ACTIVITY_LOG
22.8.3 APEX_ACTIVITY_LOG Sample Query
The following example demonstrates how to create a report that displays the total number of page views and the average page view time in the past 24 hours for application 9529, and grouped by userid:
SELECT COUNT(*), AVG(elap), userid FROM APEX_ACTIVITY_LOG WHERE time_stamp > (SYSDATE-1) AND flow_id = 9529 GROUP BY userid
Keep in mind that activity logging in an Oracle Application Express instance is rotated between two different log tables. Because there are two log tables, logging information is only as current as the oldest available entry in the logs. To persist your application specific log information for all time, you must either copy the log information into your own application table or implement logging directly in your application.
Parent topic: Creating Custom Activity Reports Using APEX_ACTIVITY_LOG