Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Tracing Services PIC Operations

    Tracing operations track all adaptive services operations and record them in a log file. The logged error descriptions provide detailed information to help you solve problems faster.

    By default, no events are traced. If you include the traceoptions statement at the [edit services adaptive-services-pics] or [edit services logging] hierarchy level, the default tracing behavior is the following:

    • Important events are logged in a file called serviced located in the /var/log directory.
    • When the file serviced reaches 128 kilobytes (KB), it is renamed serviced.0, then serviced.1, and so on, until there are three trace files. Then the oldest trace file (serviced.2) is overwritten. (For more information about how log files are created, see the Junos OS System Log Messages Reference.)
    • Log files can be accessed only by the user who configures the tracing operation.

    You cannot change the directory (/var/log) in which trace files are located. However, you can customize the other trace file settings by including the following statements:

    file filename <files number> <match regular-expression> <size size> <world-readable | no-world-readable>;
    flag {all;command-queued;config;handshake;init;interfaces;mib;removed-client;show;}

    You include these statements at the [edit services adaptive-services-pics traceoptions] or [edit services logging traceoptions] hierarchy level.

    These statements are described in the following sections:

    Configuring the Adaptive Services Log Filename

    By default, the name of the file that records trace output is serviced. You can specify a different name by including the file statement at the [edit services adaptive-services-pics traceoptions] or [edit services logging traceoptions] hierarchy level:

    file filename;

    Configuring the Number and Size of Adaptive Services Log Files

    By default, when the trace file reaches 128 kilobytes (KB) in size, it is renamed filename.0, then filename.1, and so on, until there are three trace files. Then the oldest trace file (filename.2) is overwritten.

    You can configure the limits on the number and size of trace files by including the following statements at the [edit services adaptive-services-pics traceoptions] or [edit services logging traceoptions] hierarchy level:

    file <filename> files number size size;

    For example, set the maximum file size to 2 MB, and the maximum number of files to 20. When the file that receives the output of the tracing operation (filename) reaches 2 MB, filename is renamed filename.0, and a new file called filename is created. When the new filename reaches 2 MB, filename.0 is renamed filename.1 and filename is renamed filename.0. This process repeats until there are 20 trace files. Then the oldest file (filename.19) is overwritten by the newest file (filename.0).

    The number of files can be from 2 through 1000 files. The file size of each file can be from 10 KB through 1 gigabyte (GB).

    Configuring Access to the Log File

    By default, log files can be accessed only by the user who configures the tracing operation.

    To specify that any user can read all log files, include the file world-readable statement at the [edit services adaptive-services-pics traceoptions] or [edit services logging traceoptions] hierarchy level:

    file <filename> world-readable;

    To explicitly set the default behavior, include the file no-world-readable statement at the [edit services adaptive-services-pics traceoptions] or [edit services logging traceoptions] hierarchy level:

    file <filename> no-world-readable;

    Configuring a Regular Expression for Lines to Be Logged

    By default, the trace operation output includes all lines relevant to the logged events.

    You can refine the output by including the match statement at the [edit services adaptive-services-pics traceoptions file filename] or [edit services logging traceoptions] hierarchy level and specifying a regular expression (regex) to be matched:

    file <filename> match regular-expression;

    Configuring the Trace Operations

    By default, if the traceoptions configuration is present, only important events are logged. You can configure the trace operations to be logged by including the following statements at the [edit services adaptive-services-pics traceoptions] or [edit services logging traceoptions] hierarchy level:

    flag {all;configuration;routing-protocol;routing-socket;snmp;}

    Table 1 describes the meaning of the adaptive services tracing flags.

    Table 1: Adaptive Services Tracing Flags

    Flag

    Description

    Default Setting

    all

    Trace all operations.

    Off

    command-queued

    Trace command enqueue events.

    Off

    config

    Log reading of the configuration at the [edit services] hierarchy level.

    Off

    handshake

    Trace handshake events.

    Off

    init

    Trace initialization events.

    Off

    interfaces

    Trace interface events.

    Off

    mib

    Trace GGSN SNMP MIB events.

    Off

    removed-client

    Trace client cleanup events.

    Off

    show

    Trace CLI command servicing.

    Off

    To display the end of the log, issue the show log serviced | last operational mode command:

    [edit]user@host# run show log serviced | last

    Published: 2013-02-15