Skip Headers
Oracle® Traffic Director Administrator's Guide
11g Release 1 (11.1.1.7.0)

Part Number E21036-04
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

12.6 Configuring Oracle Traffic Director to Rotate Logs Automatically

You can configure Oracle Traffic Director to rotate logs automatically at specified times or intervals by creating log-rotation events.

You can create log-rotation events by using either the administration console or the CLI.

Note:

The CLI examples in this section are shown in shell mode (tadm>). For information about invoking the CLI shell, see Section 2.3.1, "Accessing the Command-Line Interface."

Creating Log-Rotation Events Using the Administration Console

To create log-rotation events by using the administration console, do the following:

  1. Log in to the administration console, as described in Section 2.3.2, "Accessing the Administration Console."

  2. Click the Configurations button that is situated at the upper left corner of the page.

    A list of the available configurations is displayed.

  3. Select the configuration for which you want to create log-rotation events.

  4. In the navigation pane, select Logging.

    The Log Preferences page is displayed.

  5. Go to the Log Rotation section of the page.

  6. If you want Oracle Traffic Director to run a specific command on the rotated log files, specify the absolute path to the required command in the Archive Command field.

    For example, if you specify /usr/bin/gzip as the archive command, after rotating the logs, Oracle Traffic Director compresses the rotated log files by running the following commands:

    $ /usr/bin/gzip access-yyyymmddhhmm.log
    $ /usr/bin/gzip server-yyyymmddhhmm.log
    
  7. Click New Event.

    The New Log Rotation Event dialog box is displayed.

  8. Specify whether the event is for the server log or the access log.

  9. Specify the interval or time of the day at which the log should be updated, and then click OK.

    • A message, confirming creation of the event, is displayed in the Console Messages pane.

    • The new event is displayed in the Log Rotation Events list.

      • New events are enabled by default. To change the status, select the Enable/Disable check box.

      • To delete an event, click the Delete button.

    • In addition, the Deployment Pending message is displayed at the top of the main pane. You can either deploy the updated configuration immediately by clicking Deploy Changes, or you can do so later after making further changes as described in Section 4.3, "Deploying a Configuration."

Creating Log-Rotation Events Using the CLI

To create log-rotation events, run the create-event command.

For example, the following commands configure Oracle Traffic Director to rotate the access logs and server logs for all instances of the configuration soa after every 3600 seconds and 7200 seconds respectively.

tadm> create-event --config=soa --command=rotate-access-log --interval=3600
OTD-70201 Command 'create-event' ran successfully.

tadm> create-event --config=soa --command=rotate-log --interval=7200
OTD-70201 Command 'create-event' ran successfully.

Note:

If you want Oracle Traffic Director to run a specific command on the rotated log files, specify the absolute path to the required command by running the set-log-prop command as shown in the following example:

tadm> set-log-prop --config=soa archive-command=/usr/bin/gzip
OTD-70201 Command 'set-log-prop' ran successfully.

In this example, after rotating the logs, Oracle Traffic Director compresses the rotated log files by running the following commands:

$ /usr/bin/gzip access-yyyymmddhhmm.log
$ /usr/bin/gzip server-yyyymmddhhmm.log

For the updated configuration to take effect, you should deploy it to the Oracle Traffic Director instances by using the deploy-config command.

For more information about create-event, see the Oracle Traffic Director Command-Line Reference or run the command with the --help option.