Updated 26 June 2024

For all of my ORDS demos, I’m running it as a standalone process. There’s no app server (Tomcat or Weblogic, and that’s OK. Your needs may require otherwise, and that’s OK too.

When running in a standalone configuration like this, ORDS is serving content via HTTP(S) an embedded Jetty web server. Jetty is an Eclipse project. Very cool stuff – used by LOTS of solutions out there.

Anyhow, a customer asked:

Hi,

How can we enable the webserver logs for ORDS standalone?

Or in other words, how do we get a running list of all the web server requests, response code, timings, etc for ORDS?

Thankfully it’s pretty easy.

ORDS 22.1 to latest (24.2)

This information is sourced from the docs, 5.2.3 Using Jetty XML Configuration Files.

In your ORDS configdir folder, find the global directory.

Create under that, standalone/etc

Then in THAT directory, create an jetty-access-log.xml file.

Then in THAT file, add these lines

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Ref id="Handlers">
<Call name="addHandler">
<Arg>
<New id="RequestLog" class="org.eclipse.jetty.server.handler.RequestLogHandler">
<Set name="requestLog">
<New id="RequestLogImpl" class="org.eclipse.jetty.server.CustomRequestLog">
<Arg>/valid/path/to/ords/ords-access.log</Arg>
<Arg>%{remote}a - %u %t "%r" %s %O "%{Referer}i" "%{User-Agent}i"</Arg>
</New>
</Set>
</New>
</Arg>
</Call>
</Ref>
</Configure>

NOTE: You need to provide a valid path here, or ORDS will fail to startup.

<Arg>/valid/path/to/ords/ords-access.log</Arg>

Ok, let’s make it go!

Restart ORDS, then make a few HTTP requests. For example, you could login to SQL Developer Web or use some of your REST APIs.

You’ll see the access.log created in that directory you listed above, populated with your HTTP requests.

There’s a TON of Jetty Config Options Available

You’ll want to take a look at the Jetty API docs.

For example, here’s one I’ve been asked before, how to control the response header.

Some people don’t want to advertise this, you can turn it OFF.
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.

13 Comments

  1. Sorry, my xml was stripped from the comment: Here the code without , but you can guess.
    ?xml version=“1.0” encoding=“UTF-8”?
    !DOCTYPE Configure PUBLIC “-//Jetty//Configure//EN” “http://www.eclipse.org/jetty/configure.dtd”
    Configure id=“Server” class=“org.eclipse.jetty.server.Server”
    Call name=“getMimeTypes”
    Call name=“addMimeMapping”
    Arg>.mjsapplication/javascript</Arg
    /Call
    /Call
    /Configure

  2. I use pdf.js, which i put in global/doc_root. This worked well with version 3 of pdf.js. Version 4 of pdf.js uses Javascript modules with the extension .mjs. However, these are not delivered by ORDS-Jetty (24.2) with the mimetype “application/javascript”, so that they are not recognized and interpreted as Javascript by the browser. I tried to set the mimetype via global/standalone/etc/jetty-mime-config.xml as

    .mjs
    application/javascript

    but this was unsuccessful. How can I add the mimetype?

  3. Any news on the question from Rich Soule on where to put the file in the newer versions of ORDS? In Standalone mode, the config file (settings.xml) is now under $ORDS_CONFIG_FOLDER$\global
    There’s a standalone folder in $ORDS_HOME$\ but it’s completely empty. There’s another standalone folder in $ORDS_CONFIG_FOLDER$\global

    So, where to put/create the etc folder and the jetty-http.xml file?

  4. soumya sundar das Reply

    Hi jeff,

    I am using nssm tool(https://nssm.cc/download) and created a service in windows to startup/shutdown the ords service.
    Now I am looking for a way out to capture the output which is observed once you start the ords
    e.g java -jar D:\ords21.2\ords.war standalone

    Is there anyway i can capture this using any options or anything?

    Would really appreciate if you could help me on this.

  5. Jeff,

    With ORDS 22.1 we no longer have a ORDS-INSTALL-HOME\standalone by default when running ORDS in standalone mode…

    I’ve not played around with this yet with ORDS 22.1… Should we be adding a \standalone\etc directory to our ORDS-INSTALL-HOME?

    Also, correct me if I’m wrong, but wouldn’t this really go into the ORDS-CONFIGURATION-HOME and not the ORDS-INSTALL-HOME?

    Thanks!

  6. Ankush Srivastava Reply

    Hello Jeff,

    We were planning to deploy ORDS on Production with the embedded jetty option as our other internal java apps for our project are not on Tomcat/Weblogic.
    Do you think standalone is good to go ahead with in this case?
    Please can you specify any disadvantages as I am not able to find it anywhere. Thanks.

    • Not having the features of Tomcat, logging/config/authentication tie in features come to mind. You can get a lot of this from Jetty, but Tomcat makes it much easier.

Write A Comment