Is it just me, or does Oracle pick useless defaults? The latest case I encountered (just one of several) is the default Oracle Application Server configuration for logging. Both the HTTP Server ErrorLog and CustomLog use rotatelogs, but if they go so far as to configure rotatelogs, why not make some sensible defaults?
Here are the defaults I found at a recent OAS 10.1.2.0.2 installation:
ErrorLog "|/u01/oracle/product/10.1.2/midtier/Apache/Apache/bin/rotatelogs /u01/oracle/product/10.1.2/midtier/Apache/Apache/logs/error_log 43200"
CustomLog "|/u01/oracle/product/10.1.2/midtier/Apache/Apache/bin/rotatelogs /u01/oracle/product/10.1.2/midtier/Apache/Apache/logs/access_log 43200" common
My personal favorite practice is to update these parameters so that
- The rollover time for each log is somewhere close to midnight (at least for part of the year).
- The logfile name makes sense.
Here is what I usually use for my own “default” settings:
ErrorLog "|/u01/oracle/product/10.1.2/midtier/Apache/Apache/bin/rotatelogs /u01/oracle/product/10.1.2/midtier/Apache/Apache/logs/error_log.%Y-%m-%d-%H_%M 86400 -300"
CustomLog "|/u01/oracle/product/10.1.2/midtier/Apache/Apache/bin/rotatelogs /u01/oracle/product/10.1.2/midtier/Apache/Apache/logs/access_log.%Y-%m-%d-%H_%M 86400 -300" common
Let me explain:
- The format (%Y-%m-%d-%H_%M) will make sure that logfiles come out looking like access_log.2007-06-12-00-00 (when they roll over at midnight)
- The 86400 part is how often to roll over to a new logfile, in seconds. 86400 is the number of seconds in a day, so this will cause logfiles to roll over once per day.
- The -300 is how many minutes away from GMT the logfile will roll over. In this case, it will roll over 5 hours before 00:00 GMT (midnight GMT). For me, in Central time, that means that at least for part of the year, the logfiles should roll over at midnight. The downside of this approach is that it doesn’t automatically adjust for DST, so you’ll have to make the modification manually if it’s really important to you.
I also use the non-default parameter “
UseWebCacheIp On” in the middle tier which makes the logfiles much more useful by putting the actual client IP address in the HTTP Server logfiles. Without this parameter, the HTTP Server logfiles are filled with the IP address of the webcache server (usually the same host as the HTTP Server).
That’s my rant about logfiles for Apache. I guess it’s the small things in life that really make me happy .