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.

Docs

SettingDescription
standalone.access.logSpecifies the path to the folder to store HTTP request access logs. If not specified, then no access log is generated.
If the value has a valid directory, you’ll get your access logs.

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
With ORDS shutdown, add the config setting, start ORDS back up

Once ORDS is running, you’ll see in the standard out from your console that the setting has been recognized –

This is the output you are looking for.

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.

Cool.

And then if I peek into that file..

I’m hitting ORDS from the same machine it’s running on.

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:

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.

Author

I'm a Distinguished Product Manager at Oracle. My mission is to help you and your company be more efficient with our database tools.

Write A Comment