Home

Traffic Server Software Developers Kit

Debugging Functions

INKDebug

Issues debug statements.

Prototype

void INKDebug (const char *tag, const char *format_str, ...)

Arguments

tag is the Traffic Server parameter that enables Traffic Server to print out format_str

... is a variable for format_str

Description

If debugging is enabled, then INKDebug prints out the statement format_str. There are two ways to enable debugging:

  • Run Traffic Server with the -Ttag option.
    For example, if the tag is

    my-plugin: traffic_server -Tmy-plugin

    then the debug output goes to traffic.out

  • Set the following variables in records.config (in the Traffic Server config directory):

    proxy.config.diags.debug.enabled INT 1
    proxy.config.diags.debug.tags STRING debug-tag-name

    In this case, debug output goes to traffic.out

Example

INKDebug ("my-plugin", “Starting my-plugin at %d\n”, the_time);

The statement “Starting my-plugin at <time>appears whenever you run Traffic Server with the my-plugin tag:

traffic_server -Tmy-plugin