Configuration Syntax

phhttpd considers the different types of loggable events as 'sources'. The administrator creates places for these sources to be sent. Some sources are generated in a global context and only need one place to go. Other sources are conceptually sent from a virtual server and can have different destinations for each virtual server.

A destination is expressed by the 'route' entity; you're establishing a route between the event source and the destination for an event to take.
	<route source="LOGSOURCE" type="TYPE" ... />
	...
The source is one of:

accessSuccessfully answered requests are logged
agentThe value given in the 'User-Agent' HTTP request header
errorError conditions, fatal or otherwise
refererThe string given in the 'Referer' HTTP request header
statusGeneral status messages that reflect what the server is doing.

The attributes that follow type are dependent on the type given for that destination. Type can be:

syslog facility="FAC" level="lev"

Events are sent out through the syslog() interface at the given level and facility. The final destination of the messages is not up to phhttpd, see the OS's syslog configuration for details.

file file="PATH" mode="OCTALMODE"

Logs are written directly to a file at the given path. If it doesn't exist, it is created with the given mode. Writes to this file will be buffered and written at one second intervals or when the buffer fills up.

fd fd="NUM"

Events are written directly the the numbered file descriptor given. Typically this is used to write drastic errors to 'stderr' or for debugging.

The route entity may appear in three places. In the global section it is used to specify the destination of server wide events. In the virtual section it is used to specify the destination of virtual specific events for the virtual server the route entity occurs in.

It may also occur in a special template section in the global section. This is used to define a skeletal logging policy that may be applied to many virtual servers.
<global>
	<template name=NAME />
		<route ... />
		<route ... />
	</template>
</global>
This will create a template that defines destinations for all the sources specified in the 'route' entities. This may then be referred to in a virtual section:
<virtual ...>
	...
	<applytemplate name="NAME" />
</virtual>
All the events generated in this virtual for the sources covered by the template will be sent out the destinations specified in the template. XXX Eventually it will even let you modify the filenames per virtual.. go team.

When a destination is defined it may be given a tag . This tag can then later be used to express the same destination. This allows the administrator to log multiple sources to the same file without typing like a madman.
	...
	<route source="SOURCE" tag="BLAH" ... />
	...
	<route SOURCE="SOURCE" tagref="BLAH />
	...
The all attributes of the destination are stored in the tag, but the source remains independent.