This comes up frequently – how do we track what requests Standalone ORDS is handling? One possible answer is adding webserver access logs for ORDS.
Thankfully this is covered in both the Docs and on Oracle-Base, but I figured I’d do a quick rundown of the feature as well here.
If you’re running ORDS standalone, then don’t have Apache (Tomcat) or Weblogic handy to do things like handling your logs for you.
But that’s OK, because the ORDS webserver has a setting you can use to enable this logging.
Setting | Description |
---|---|
standalone.access.log | Specifies the path to the folder to store HTTP request access logs. If not specified, then no access log is generated. |
Turning it on
You need to know two things:
- where is your ORDS configuration directory
- where do you want to stuff your logs
Knowing that, I can run something similar to this:
ords --config c:\ords\22_config config set standalone.access.log C:\ORDS\22_config\standalone\etc
Once ORDS is running, you’ll see in the standard out from your console that the setting has been recognized –
The actual log
So with ORDS running, I make a few requests…
And then I waddle over to that directory to see what I can find.
And then if I peek into that file..
But Jeff, I want to record what the database is doing AFTER I make ORDS calls
ORDS doesn’t record this.
But, you can take advantage of either/both:
- Oracle Database Auditing – let the database record what it’s doing
- ORDS Pre-Hook
On ORDS Pre-Hook feature, you can have a block of PL/SQL code run before any REST API is dispatched. You could have this PL/SQL block do something like…INSERT something to a TABLE.
Our friends over at JMJ Cloud demonstrate exactly this here.