Skip to main content
Version: 1.320.x

Logging Mechanism

Actions taken by users on DbRunner are logged in real time. Logs of user actions are stored in the app_logs table in the database.

Application logs can be accessed from the Settings -> App Logs page. You must be an administrator to access these logs. You can also download the log file here or empty the existing log file.

app_logs Table

User actions are recorded in this table. The table's structure is as follows. These logs can be collected from external log collection applications.

CREATE TABLE app_logs (
logid int(11) NOT NULL,
dtm datetime NOT NULL DEFAULT current_timestamp(),
userid int(11) DEFAULT NULL,
username varchar(255) DEFAULT NULL,
req_url text DEFAULT NULL,
req_method varchar(155) DEFAULT NULL,
req_query text DEFAULT NULL,
req_body text DEFAULT NULL,
response text DEFAULT NULL,
client_addr varchar(255) DEFAULT NULL,
action varchar(155) DEFAULT NULL,
app_name varchar(55) DEFAULT NULL
)

The logid column is a unique and auto-increment column.

You can access the table from external log collection applications as follows.

GRANT SELECT
ON <database_name>.app_logs
TO '<logger username>'@'<server_ip_addr>'
IDENTIFIED BY "<password>";

A user must be created for the external application in the DbRunner database using the command. Once this is done, the created user can access the relevant log table.

Log File

Application logs are stored in the log/app.log file under the application's main directory. This log file can also be accessed from the Settings -> App Logs page.

Logging Queries Run on the Oracle Database

When users run a query via DbRunner, a session-specific definition is made in the Oracle database before executing the query to ensure it is reflected in the Oracle database logs. This definition allows you to access the project and deployment context of the query.

The following commands are run before executing the queries.

exec sys.dbms_session.set_identifier(
'Project<ProjectId> Deploy<DeployId> Issue<IssueNo>'
);
exec dbms_application_info.set_client_info(
'Project<ProjectId> Deploy<DeployId> Issue<IssueNo>'
);
exec dbms_application_info.set_module('ScriptExecute', null);

Thanks to these definitions, relevant data can be accessed from the Oracle database logs, Client Info and Identifier columns.