12.5 Rotating Logs Manually

You can rotate the server and access logs of Oracle Traffic Director instances manually 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."

Rotating Logs Manually Using the Administration Console

To rotate logs 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 rotate logs.

    To rotate logs for all the instances of the selected configuration, do the following:

    1. In the navigation pane, select Logging.

      The Log Preferences page is displayed.

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

    3. 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
      
    4. Click Rotate Logs Now.

      The server and access logs, including any virtual server-specific logs, for all the instances of the configuration are archived.

    To rotate logs for a specific instance of the selected configuration, do the following:

    1. In the navigation pane, select Instances.

      The Instances page is displayed.

    2. Click the Rotate Logs button for the required instance.

      The server and access logs, including any virtual server-specific logs, for the selected instance are archived.

    A message is displayed in the Console Messages pane confirming that the logs were rotated.

Rotating Logs Manually Using the CLI

To rotate logs for one or more instances of a configuration, run the rotate-log command.

For example, the following command rotates the access and server logs, including any virtual server-specific logs, for the instance of the configuration soa running on the nodes soa1.example.com and soa2.example.com.

tadm> rotate-log --config=soa soa1.example.com soa2.example.com
OTD-70201 Command 'rotate-log' ran successfully.

If you do not specify any node, the logs are rotated for all the instances of the configuration.

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 more information about rotate-log and set-log-prop, see the Oracle Traffic Director Command-Line Reference or run the command with the --help option.