.. role:: ref(emphasis)

.. _vsl(7):

===
VSL
===

-----------------------------
Varnish Shared Memory Logging
-----------------------------

:Manual section: 7

OVERVIEW
========

This document describes the format and content of all the Varnish shared memory
logging tags. These tags are used by the varnishlog(1), varnishtop(1), etc.
logging tools supplied with Varnish.

VSL tags
~~~~~~~~

.. include:: ../include/vsl-tags.rst

TIMESTAMPS
==========

Timestamps are inserted in the log on completing certain events during
the worker thread's task handling. The timestamps has a label showing
which event was completed. The reported fields show the absolute time
of the event, the time spent since the start of the task and the time
spent since the last timestamp was logged.

The timestamps logged automatically by Varnish are inserted after
completing events that are expected to have delays (e.g. network IO or
spending time on a waitinglist). Timestamps can also be inserted from
VCL using the std.timestamp() method. If one is doing time consuming
tasks in the VCL configuration, it's a good idea to log a timestamp
after completing that task. This keeps the timing information in
subsequent timestamps from including the time spent on the VCL event.

Request handling timestamps
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Start
	The start of request processing (first byte received or
	restart).

Req
	Complete client request received.

ReqBody
	Client request body processed (discarded, cached or passed to
	the backend).

Waitinglist
	Came off waitinglist.

Fetch
	Fetch processing finished (completely fetched or ready for
	streaming).

Process
	Processing finished, ready to deliver the client response.

Resp
	Delivery of response to the client finished.

Restart
	Client request is being restarted.

Reset
        The client closed its connection, reset its stream or caused
        a stream error that forced Varnish to reset the stream. Request
        processing is interrupted and considered failed, with a 408
        "Request Timeout" status code.

Pipe handling timestamps
~~~~~~~~~~~~~~~~~~~~~~~~

Pipe
	Opened a pipe to the backend and forwarded the request.

PipeSess
	The pipe session has finished.

Backend fetch timestamps
~~~~~~~~~~~~~~~~~~~~~~~~

Start
	Start of the backend fetch processing.

Bereq
	Backend request sent.

Beresp
	Backend response headers received.

BerespBody
	Backend response body received.

Retry
	Backend request is being retried.

Error
	Backend request failed to vcl_backend_error.


NOTICE MESSAGES
===============

Notice messages contain informational messages about the handling of a
request. These can be exceptional circumstances encountered that causes
deviation from the normal handling. The messages are prefixed with [core]
for core Varnish generated messages, or with [<VMOD name>] for VMOD
generated messages. The [core] messages are described in detail below, see
the individual VMOD documentation for messages from VMODs.

[core] Conditional fetch wait for streaming object
	The backend answered 304 Not Modified on a conditional fetch using
	an object that has not yet been fully fetched as the stale
	template object. This can only happen when the TTL of the object
	is less than the time it takes to fetch it. The fetch is halted
	until the stale object is fully fetched, upon which the new object
	is created as normal. While waiting, any grace time on the stale
	object will be in effect.


HISTORY
=======

This document was initially written by Poul-Henning Kamp, and later updated by
Martin Blix Grydeland.


SEE ALSO
========

* :ref:`varnishhist(1)`
* :ref:`varnishlog(1)`
* :ref:`varnishncsa(1)`
* :ref:`varnishtop(1)`

COPYRIGHT
=========

This document is licensed under the same licence as Varnish
itself. See LICENCE for details.

* Copyright (c) 2006 Verdens Gang AS
* Copyright (c) 2006-2015 Varnish Software AS
