12.2 Viewing Logs

You can view the access and server logs of Oracle Traffic Director instances and virtual servers by using either the administration console or the CLI.

Note:

  • Besides using the CLI and administration console, you can also use the standard operating-system commands such as ls and more to list and view the log files.

  • The Log Viewer in the administration console and the get-access-log CLI command display only the log entries that currently exist in the access log file on the disk. They do not display items from the access-log buffer (see Section 15.7, "Configuring Access-Log Buffer Settings")).

  • 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."

Viewing Logs Using the Administration Console

To view log data for a node, an instance, or virtual server within an instance 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 view logs.

  4. In the Common Tasks pane, click View Logs.

    The Oracle Traffic Director Log Viewer window is displayed.

  5. Click the Select Node, Instance, or Virtual Server button, and select the node, instance, or virtual server for which you want to view log data.

    • To view the server log, select the Server Log tab.

    • To view the access log, select the Access Log tab.

    To search for specific records, click the Search Options button near the upper right corner of the window, and specify the appropriate filters.

    You can refresh the display by clicking the refresh button near the Search Options button. Note that when you refresh the Log Viewer by clicking the refresh button, the search options and sort order are reset to the default settings.

    If you want the log viewer to be refreshed automatically after every 15 seconds, select the Auto Refresh check box.

Viewing Logs Using the CLI

  • To view the access log for an instance or a virtual server, run the get-access-log command.

    For example, the following command displays the access-log records with status=304 for the instance of the configuration soa running on the node example.com.

    tadm> get-access-log --status-code=304 --config=soa example.com
    format=%Ses->client.ip% - %Req->vars.auth-user% [%SYSDATE%] "%Req->reqpb.clf-request%" %Req->srvhdrs.clf-status% %Req->srvhdrs.content-length%
    10.177.243.207 - - [25/Aug/2011:04:41:34 -0700] "GET / HTTP/1.1" 304 0
    10.177.243.207 - - [25/Aug/2011:04:41:35 -0700] "GET / HTTP/1.1" 304 0
    

    The first line shows the format that is currently defined for the access log.

    To view the access log for a particular virtual server within the instance, specify the virtual server name by using the --vs option.

  • To view the server log for an instance or a virtual server, run the get-log command.

    For example, the following command displays the server-log records with log level warning:1 or higher for the instance of the configuration soa running on the node example.com.

    tadm> get-log --log-level=warning:1 --config=soa example.com
    

    To view the server log for a particular virtual server within the instance, specify the virtual server name by using the --vs option.

For more information about get-access-log and get-log, see the Oracle Traffic Director Command-Line Reference or run the commands with the --help option.