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" ... /> ... |
access | Successfully answered requests are logged |
agent | The value given in the 'User-Agent' HTTP request header |
error | Error conditions, fatal or otherwise |
referer | The string given in the 'Referer' HTTP request header |
status | General 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:
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.
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.
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> |
<virtual ...> ... <applytemplate name="NAME" /> </virtual> |
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 /> ... |