Home

Traffic Server Software Developers Kit

INKError

Writes an error to the Traffic Server error log.

Prototype

void INKError (const char *fmt, ...)

Arguments

fmt is the printf format description.

... is the argument for the format description.

Description

It is sometimes useful to log messages when errors occur. Traffic Server has a global error log file to which it writes such messages, and the function INKError is the API interface to this error log. INKError is similar to printf except that instead of writing the output to the C standard output, INKError writes output to the Traffic Server error log. One advantage of INKError over printf is that each call is atomically placed into the error log and is not garbled with other error entries (this is not an issue in single-threaded programs, but is a definite nuisance in multi-threaded programs).

Example
INKError ("couldn't retrieve client request header\n");