Example Logging Configurations

First we have a simple single virtual setup:

<logging>
	<route tag="err" source="error" type="file" mode="0600" file="/var/log/phhttp/error.log" />
	<route source="status" type="file" mode="0600" file="/var/log/phhttp/status.log" />
</logging>
</virtual>
	...
	<logs>
		<route tagref="err" source="error" />
		<route source="error" type="file" mode="0600" file="/var/log/phhttp/virt/error.log" />
		<route source="status" type="file" mode="0600" file="/var/log/phhttp/virt/status.log" />
	
	</logs>
</virtual>

This simply redirects logging for the various sources to relatively smart places. Notice how all errors are sent to one file. Next lets try a debugging style setup:

<logging>
	<route tag="stderr" source="error" type="fd" num="2" />
	<route tagref="stderr" source="status" />
	<template name="virtdebug"a/>
		<route tagref="stderr" source="error" />
		<route tagref="stderr" source="access" />
		<route tagref="stderr" source="agent" />
		<route tagref="stderr" source="referer" />
		<route tagref="stderr" source="status" />
	</template>
</logging>
</virtual>
	...
	<logs>
		<applytemplate name="virtdebug" /gt;
	</logs>
</virtual>

Here we log important things to the terminal that starts the program, and catch everything else in a enormous file that we might look at later.