Thursday, January 12, 2017

How to add an NCSA style Access Log to ORDS Standalone

What ORDS Standalone is

ORDS Standalone webserver which is Eclipse Jetty, https://eclipse.org/jetty/ . For the standalone, ORDS sends output to STDOUT, it runs on the command line. That means there's nothing like a control commands like startup, shutdown,status nor log files, access logs. It's bare bones intentionally to get up and running fast. Then it's recommended for anything with lots of volume more to a more full featured webserver like Tomcat or WLS.

Standalone Startup

With all that said, it is quite simple to use the standalone for most cases. When doing this the most important thing is just a startup script so that when the machine/db starts the ORDS instance starts also. There's an init.d script in this blog post that can be used and adjusted as needed : http://krisrice.blogspot.com/2010/12/listener-startupshutdown-script.html

Standalone Access Logs

The other thing much needed from a standalone instance of ORDS would be an access log to see what it's getting for traffic. Here's where being Jetty based is a great thing.

This is documented for some solaris workaround only so probably missed by most. ORDS Standalone allows for customization of the Jetty server itself. Looking at the ords configuration directory there's a <path>/standalone. This will have a file named standalone.properties which looks like this which is the name/value pairs of what ORDS will configure.

Jetty is configurable by xml documents and the documentation has some really good example of what's possible. This blog post is going to focus on the Access Log section here: https://eclipse.org/jetty/documentation/current/configuring-jetty-request-logs.html

In that same directory, create a folder named "etc" and in there create a file named "jetty-http.xml" . Then drop this into the file