[coldbox 3.7] RelaxLogs Allow Log Table Per defined API

Hi,

I am working on configuring Relax to provide the documentation of a few APIs that we are building in Coldbox. Is it possible to have Relax look at a different DB table per defined API? Or do I need to have a separate ColdBox / Relax install for each API to allow the relax logs to point to a different API for each.

This is my goal / desired configuration would be similart to the following:

All logging will go into a MSSQL database called api_logs with a table named matching the api app name (eg: api1_log, etc.). This would be configured via the DB appender within remote api coldbox instance. The goal being here having separate tables to keep API log activity segmented to allow easier export/backup of these API log entry tables as they grow vs having 1 massive log table. I know I can have categories that I can inject a specific logger via a statement similar to below:

property name="logger" inject="logbox:logger:api1Logger";

However this seemingly will still flow into the single datasource / table of api_logs and only be segmented via the category when logged inside the table. However since we manage multiple applications / APIs we would like segment due to internal business requirements.

Example Application Domains:

http://app1.com/api/ ← Remote Event Driven API using Coldbox
http://app2.com/api/ ← Remote Event Driven API using Coldbox

Example API Admin Location: where RELAX is installed

http://apiadmin.mydomain.com/relax/home

The goal being here is that we use the RELAX dsl to define all of our APIs within a single installation of Relax to provide internal testing RelaxURL tool and export of our documentation for distribution / publication as needed.

The question is inside of each API’s Relax.cfc would it be possible to override the relaxLogs DB table where logs for that API live?

settings = {
// Relax Version: DO NOT ALTER
version = this.version,
// The location of the relaxed APIs, in instantiation path
apiLocationPath = “#moduleMapping#.resources”,
// Default API to load
defaultAPI = “myapi”,
// History stack size, the number of history items to track in the RelaxURL
maxHistory = 10,
// logbox integration information needed for log viewer to work
// this means that it can read tables that are written using the logbox’s DB Appender.
relaxLogs = {
// THE CF DATASOURCE NAME
datasource = “relax”,
// THE DB TO USE FOR LOGS, AVAILABLE ADAPTERS ARE: mysql, mssql, postgres, oracle
adapter = “mssql”,
// THE TABLE WHERE THE LOGS ARE
table = “api_logs”,
// PAGING MAX ROWS
maxRows = 50,
// PAGING CARROUSEL BANDGAP
bandGap = 3
}
};

Also I didn’t see a way to search by the APPENDER category which in a sense is very similar to this physical db table separation I’m looking for.

Any thoughts on this setup / ideas on how to accomplish this would be much appreciated. I’m trying to avoid having Relax installed on a per API level because this is purely a remote API and there is no Coldbox views etc. Otherwise I will have to figure out how to secure the /relax/home routes for each API that we write.

Thanks!
Tim