<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:lighttpd.net:lighttpd2/doc1">
	<short>
		offers various utilities to aid you debug a problem.
	</short>

	<action name="debug.show_connections">
		<short>shows a page similar to the one from mod_status, listing all active connections</short>
		<description><markdown>
			By specifying one or more "connection ids" via querystring (parameter "con"), one can request additional debug output for specific connections.
		</markdown></description>
		<example>
			<config>
				if req.path == "/debug/connections" { debug.show_connections; }
			</config>
		</example>
	</action>

	<action name="debug.profiler_dump">
		<short>dumps all allocated memory to the profiler output file if profiling enabled</short>

		<description><markdown>
			lighttpd2 needs to be compiled with profiler support, and profiling has to be enabled by setting the environment variable `LIGHTY_PROFILE_MEM` to the path of a target log file.
		</markdown></description>
	</action>

	<action name="debug.show_events">
		<short>shows a plain text list of all events</short>
		<description><markdown>
			this is a very low level debug tool for developers.
		</markdown></description>
		<example>
			<config>
				if req.path == "/debug/events" { debug.show_events; }
			</config>
		</example>
	</action>

	<setup name="debug.show_events_after_shutdown">
		<short>time in seconds after start of shutdown to log remaining active events</short>
		<parameter name="timeout">
			<short>timeout after which to display events (default: disabled)</short>
		</parameter>
		<parameter name="repeat">
			<short>timeout after which to repeat displaying events (default: disabled)</short>
		</parameter>

		<description><markdown>
			this is a very low level debug tool for developers; it shows which event listeners keep lighttpd2 alive when it should stop.
		</markdown></description>

		<example>
			<config>
				setup { debug.show_events_after_shutdown 5; }
				setup { debug.show_events_after_shutdown 5, 15; }
			</config>
		</example>
	</setup>
</module>
