<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="info">
	<!--

		Available ThreadContext map keys:

		date, time, tz, x-event, x-category, x-severity, x-status, x-ctx, x-ctx-override, x-comment, x-vhost, x-app, x-appinst, x-duration, s-ip, 
		s-port, s-uri, c-ip, c-proto, c-referrer, c-user-agent, c-client-id, cs-bytes, sc-bytes, x-stream-id, x-spos, cs-stream-bytes, sc-stream-bytes, 
		x-sname, x-sname-query, x-file-name, x-file-ext, x-file-size, x-file-length, x-suri, x-suri-stem, x-suri-query, cs-uri-stem, cs-uri-query, 
		x-forwarded-ip, x-class-fqcn, x-class-name, x-class-packagename, x-vhost-context, x-app-context, x-appinst-context

	-->
	<Appenders>
		<Console name="stdout" target="SYSTEM_OUT">
			<PatternLayout>
				<Pattern>%replace{%X{x-severity}}{^$}{-} %replace{%X{x-category}}{^$}{-} %replace{%X{x-event}}{^$}{-} %replace{%X{x-ctx}}{^$}{-} %replace{%X{x-comment}}{^$}{-}%n</Pattern>
				<AlwaysWriteExceptions>false</AlwaysWriteExceptions>
			</PatternLayout>
		</Console>

		<RollingFile name="serverAccess" fileName="/opt/wowza/logs/wowzastreamingengine_access.log" filePattern="/opt/wowza/logs/wowzastreamingengine_access.%d{yyyy-MM-dd}.log">
			<PatternLayout>
				<Header>#Version: 1.0\n#Start-Date: %d{YYY-MM-dd HH:mm:ss zzz}\n#Software: ${sys:wse-software-version}\n#Date: %d{YYY-MM-dd}\n#Fields: date\ttime\ttz\tx-event\tx-category\tx-severity\tx-status\tx-ctx\tx-comment\tx-vhost\tx-app\tx-appinst\tx-duration\ts-ip\ts-port\ts-uri\tc-ip\tc-proto\tc-referrer\tc-user-agent\tc-client-id\tcs-bytes\tsc-bytes\tx-stream-id\tx-spos\tcs-stream-bytes\tsc-stream-bytes\tx-sname\tx-sname-query\tx-file-name\tx-file-ext\tx-file-size\tx-file-length\tx-suri\tx-suri-stem\tx-suri-query\tcs-uri-stem\tcs-uri-query%n</Header>
				<Pattern>%d{yyyy-MM-dd}\t%d{HH:mm:ss}\t%d{z}\t%replace{%X{x-event}}{^$}{-}\t%replace{%X{x-category}}{^$}{-}\t%replace{%X{x-severity}}{^$}{-}\t%replace{%X{x-status}}{^$}{-}\t%replace{%X{x-ctx}}{^$}{-}\t%replace{%X{x-comment}}{^$}{-}\t%replace{%X{x-vhost}}{^$}{-}\t%replace{%X{x-app}}{^$}{-}\t%replace{%X{x-appinst}}{^$}{-}\t%replace{%X{x-duration}}{^$}{-}\t%replace{%X{s-ip}}{^$}{-}\t%replace{%X{s-port}}{^$}{-}\t%replace{%X{s-uri}}{^$}{-}\t%replace{%X{c-ip}}{^$}{-}\t%replace{%X{c-proto}}{^$}{-}\t%replace{%X{c-referrer}}{^$}{-}\t%replace{%X{c-user-agent}}{^$}{-}\t%replace{%X{c-client-id}}{^$}{-}\t%replace{%X{cs-bytes}}{^$}{-}\t%replace{%X{sc-bytes}}{^$}{-}\t%replace{%X{x-stream-id}}{^$}{-}\t%replace{%X{x-spos}}{^$}{-}\t%replace{%X{cs-stream-bytes}}{^$}{-}\t%replace{%X{sc-stream-bytes}}{^$}{-}\t%replace{%X{x-sname}}{^$}{-}\t%replace{%X{x-sname-query}}{^$}{-}\t%replace{%X{x-file-name}}{^$}{-}\t%replace{%X{x-file-ext}}{^$}{-}\t%replace{%X{x-file-size}}{^$}{-}\t%replace{%X{x-file-length}}{^$}{-}\t%replace{%X{x-suri}}{^$}{-}\t%replace{%X{x-suri-stem}}{^$}{-}\t%replace{%X{x-suri-query}}{^$}{-}\t%replace{%X{cs-uri-stem}}{^$}{-}\t%replace{%X{cs-uri-query}}{^$}{-}%n</Pattern>
				<AlwaysWriteExceptions>false</AlwaysWriteExceptions>
			</PatternLayout>
			<Policies>
				<TimeBasedTriggeringPolicy />
			</Policies>
			<DefaultRolloverStrategy>
				<Delete basePath="/opt/wowza/logs" maxDepth="1">
					<IfLastModified age="14d" />
				</Delete>
			</DefaultRolloverStrategy>
		</RollingFile>

		<RollingFile name="serverError" fileName="/opt/wowza/logs/wowzastreamingengine_error.log" filePattern="/opt/wowza/logs/wowzastreamingengine_error.%d{yyyy-MM-dd}.log">
			<PatternLayout>
				<Header>#Version: 1.0\n#Start-Date: %d{YYY-MM-dd HH:mm:ss zzz}\n#Software: ${sys:wse-software-version}\n#Date: %d{YYY-MM-dd}\n#Fields: x-severity\tx-category\tx-event\tdate\ttime\tc-client-id\tc-ip\tc-port\tcs-bytes\tsc-bytes\tx-duration\tx-sname\tx-stream-id\tx-spos\tsc-stream-bytes\tcs-stream-bytes\tx-file-size\tx-file-length\tx-ctx\tx-comment%n</Header>
				<Pattern>%replace{%X{x-severity}}{^$}{-}\t%replace{%X{x-category}}{^$}{-}\t%replace{%X{x-event}}{^$}{-}\t%d{yyyy-MM-dd}\t%d{HH:mm:ss}\t%replace{%X{c-client-id}}{^$}{-}\t%replace{%X{c-ip}}{^$}{-}\t%replace{%X{c-port}}{^$}{-}\t%replace{%X{cs-bytes}}{^$}{-}\t%replace{%X{sc-bytes}}{^$}{-}\t%replace{%X{x-duration}}{^$}{-}\t%replace{%X{x-sname}}{^$}{-}\t%replace{%X{x-stream-id}}{^$}{-}\t%replace{%X{x-spos}}{^$}{-}\t%replace{%X{sc-stream-bytes}}{^$}{-}\t%replace{%X{cs-stream-bytes}}{^$}{-}\t%replace{%X{x-file-size}}{^$}{-}\t%replace{%X{x-file-length}}{^$}{-}\t%replace{%X{x-ctx}}{^$}{-}\t%replace{%X{x-comment}}{^$}{-}%n</Pattern>
				<AlwaysWriteExceptions>false</AlwaysWriteExceptions>
			</PatternLayout>
			<Policies>
				<TimeBasedTriggeringPolicy />
			</Policies>
			<DefaultRolloverStrategy>
				<Delete basePath="/opt/wowza/logs" maxDepth="1">
					<IfLastModified age="5d" />
				</Delete>
			</DefaultRolloverStrategy>
		</RollingFile>

		<RollingFile name="serverStats" fileName="/opt/wowza/logs/wowzastreamingengine_stats.log" filePattern="/opt/wowza/logs/wowzastreamingengine_stats.%d{yyyy-MM-dd}.log">
			<Filters>
				<ContextMapFilter onMatch="DENY" onMismatch="NEUTRAL">
					<KeyValuePair key="x-event" value="comment"/>
				</ContextMapFilter>
				<ContextMapFilter onMatch="ACCEPT" onMismatch="DENY" operator="or">
					<KeyValuePair key="x-category" value="session"/>
					<KeyValuePair key="x-category" value="stream"/>
				</ContextMapFilter>
			</Filters>
			<PatternLayout>
				<Header>#Version: 1.0\n#Start-Date: %d{YYY-MM-dd HH:mm:ss zzz}\n#Software: ${sys:wse-software-version}\n#Date: %d{YYY-MM-dd}\n#Fields: x-severity\tx-category\tx-event\tdate\ttime\tc-client-id\tc-ip\tc-port\tcs-bytes\tsc-bytes\tx-duration\tx-sname\tx-stream-id\tx-spos\tsc-stream-bytes\tcs-stream-bytes\tx-file-size\tx-file-length\tx-ctx\tx-comment%n</Header>
				<Pattern>%replace{%X{x-severity}}{^$}{-}\t%replace{%X{x-category}}{^$}{-}\t%replace{%X{x-event}}{^$}{-}\t%d{yyyy-MM-dd}\t%d{HH:mm:ss}\t%replace{%X{c-client-id}}{^$}{-}\t%replace{%X{c-ip}}{^$}{-}\t%replace{%X{c-port}}{^$}{-}\t%replace{%X{cs-bytes}}{^$}{-}\t%replace{%X{sc-bytes}}{^$}{-}\t%replace{%X{x-duration}}{^$}{-}\t%replace{%X{x-sname}}{^$}{-}\t%replace{%X{x-stream-id}}{^$}{-}\t%replace{%X{x-spos}}{^$}{-}\t%replace{%X{sc-stream-bytes}}{^$}{-}\t%replace{%X{cs-stream-bytes}}{^$}{-}\t%replace{%X{x-file-size}}{^$}{-}\t%replace{%X{x-file-length}}{^$}{-}\t%replace{%X{x-ctx}}{^$}{-}\t%replace{%X{x-comment}}{^$}{-}%n</Pattern>
				<AlwaysWriteExceptions>false</AlwaysWriteExceptions>
			</PatternLayout>
			<Policies>
				<TimeBasedTriggeringPolicy />
			</Policies>
			<DefaultRolloverStrategy>
				<Delete basePath="/opt/wowza/logs" maxDepth="1">
					<IfLastModified age="5d" />
				</Delete>
			</DefaultRolloverStrategy>
		</RollingFile>

		<Routing name="vhostAccess" >
			<Routes pattern="$${ctx:x-vhost-context}">
				<Route>
					<RollingFile name="vhostAccess-${ctx:x-vhost-context}" fileName="/opt/wowza/logs/${ctx:x-vhost}/wowzastreamingengine_access.log" filePattern="/opt/wowza/logs/${ctx:x-vhost}/wowzastreamingengine_access.%d{yyyy-MM-dd}.log">
						<PatternLayout>
							<Header>#Version: 1.0\n#Start-Date: %d{YYY-MM-dd HH:mm:ss zzz}\n#Software: ${sys:wse-software-version}\n#Date: %d{YYY-MM-dd}\n#Fields: date\ttime\ttz\tx-event\tx-category\tx-severity\tx-status\tx-ctx\tx-comment\tx-vhost\tx-app\tx-appinst\tx-duration\ts-ip\ts-port\ts-uri\tc-ip\tc-proto\tc-referrer\tc-user-agent\tc-client-id\tcs-bytes\tsc-bytes\tx-stream-id\tx-spos\tcs-stream-bytes\tsc-stream-bytes\tx-sname\tx-sname-query\tx-file-name\tx-file-ext\tx-file-size\tx-file-length\tx-suri\tx-suri-stem\tx-suri-query\tcs-uri-stem\tcs-uri-query%n</Header>
							<Pattern>%d{yyyy-MM-dd}\t%d{HH:mm:ss}\t%d{z}\t%replace{%X{x-event}}{^$}{-}\t%replace{%X{x-category}}{^$}{-}\t%replace{%X{x-severity}}{^$}{-}\t%replace{%X{x-status}}{^$}{-}\t%replace{%X{x-ctx}}{^$}{-}\t%replace{%X{x-comment}}{^$}{-}\t%replace{%X{x-vhost}}{^$}{-}\t%replace{%X{x-app}}{^$}{-}\t%replace{%X{x-appinst}}{^$}{-}\t%replace{%X{x-duration}}{^$}{-}\t%replace{%X{s-ip}}{^$}{-}\t%replace{%X{s-port}}{^$}{-}\t%replace{%X{s-uri}}{^$}{-}\t%replace{%X{c-ip}}{^$}{-}\t%replace{%X{c-proto}}{^$}{-}\t%replace{%X{c-referrer}}{^$}{-}\t%replace{%X{c-user-agent}}{^$}{-}\t%replace{%X{c-client-id}}{^$}{-}\t%replace{%X{cs-bytes}}{^$}{-}\t%replace{%X{sc-bytes}}{^$}{-}\t%replace{%X{x-stream-id}}{^$}{-}\t%replace{%X{x-spos}}{^$}{-}\t%replace{%X{cs-stream-bytes}}{^$}{-}\t%replace{%X{sc-stream-bytes}}{^$}{-}\t%replace{%X{x-sname}}{^$}{-}\t%replace{%X{x-sname-query}}{^$}{-}\t%replace{%X{x-file-name}}{^$}{-}\t%replace{%X{x-file-ext}}{^$}{-}\t%replace{%X{x-file-size}}{^$}{-}\t%replace{%X{x-file-length}}{^$}{-}\t%replace{%X{x-suri}}{^$}{-}\t%replace{%X{x-suri-stem}}{^$}{-}\t%replace{%X{x-suri-query}}{^$}{-}\t%replace{%X{cs-uri-stem}}{^$}{-}\t%replace{%X{cs-uri-query}}{^$}{-}%n</Pattern>
							<AlwaysWriteExceptions>false</AlwaysWriteExceptions>
						</PatternLayout>
						<Policies>
							<TimeBasedTriggeringPolicy />
						</Policies>
						<DefaultRolloverStrategy>
							<Delete basePath="/opt/wowza/logs/${ctx:x-vhost}" maxDepth="1">
								<IfLastModified age="5d" />
							</Delete>
						</DefaultRolloverStrategy>
					</RollingFile>
				</Route>
				<Route key="">
					<CountingNoOp name="DEV_NULL" />
				</Route>
			</Routes>
		</Routing>

		<Routing name="vhostError" >
			<Routes pattern="$${ctx:x-vhost-context}">
				<Route>
					<RollingFile name="vhostError-${ctx:x-vhost-context}" fileName="/opt/wowza/logs/${ctx:x-vhost}/wowzastreamingengine_error.log" filePattern="/opt/wowza/logs/${ctx:x-vhost}/wowzastreamingengine_error.%d{yyyy-MM-dd}.log">
						<PatternLayout>
							<Header>#Version: 1.0\n#Start-Date: %d{YYY-MM-dd HH:mm:ss zzz}\n#Software: ${sys:wse-software-version}\n#Date: %d{YYY-MM-dd}\n#Fields: x-severity\tx-category\tx-event\tdate\ttime\tc-client-id\tc-ip\tc-port\tcs-bytes\tsc-bytes\tx-duration\tx-sname\tx-stream-id\tx-spos\tsc-stream-bytes\tcs-stream-bytes\tx-file-size\tx-file-length\tx-ctx\tx-comment%n</Header>
							<Pattern>%replace{%X{x-severity}}{^$}{-}\t%replace{%X{x-category}}{^$}{-}\t%replace{%X{x-event}}{^$}{-}\t%d{yyyy-MM-dd}\t%d{HH:mm:ss}\t%replace{%X{c-client-id}}{^$}{-}\t%replace{%X{c-ip}}{^$}{-}\t%replace{%X{c-port}}{^$}{-}\t%replace{%X{cs-bytes}}{^$}{-}\t%replace{%X{sc-bytes}}{^$}{-}\t%replace{%X{x-duration}}{^$}{-}\t%replace{%X{x-sname}}{^$}{-}\t%replace{%X{x-stream-id}}{^$}{-}\t%replace{%X{x-spos}}{^$}{-}\t%replace{%X{sc-stream-bytes}}{^$}{-}\t%replace{%X{cs-stream-bytes}}{^$}{-}\t%replace{%X{x-file-size}}{^$}{-}\t%replace{%X{x-file-length}}{^$}{-}\t%replace{%X{x-ctx}}{^$}{-}\t%replace{%X{x-comment}}{^$}{-}%n</Pattern>
							<AlwaysWriteExceptions>false</AlwaysWriteExceptions>
						</PatternLayout>
						<Policies>
							<TimeBasedTriggeringPolicy />
						</Policies>
						<DefaultRolloverStrategy>
							<Delete basePath="/opt/wowza/logs/${ctx:x-vhost}" maxDepth="1">
								<IfLastModified age="5d" />
							</Delete>
						</DefaultRolloverStrategy>
					</RollingFile>
				</Route>
				<Route key="">
					<CountingNoOp name="DEV_NULL" />
				</Route>
			</Routes>
		</Routing>

		<Routing name="applicationAccess" >
			<Routes pattern="$${ctx:x-app-context}">
				<Route>
					<RollingFile name="applicationAccess-${ctx:x-app-context}" fileName="/opt/wowza/logs/${ctx:x-vhost}/${ctx:x-app}/wowzastreamingengine_access.log" filePattern="/opt/wowza/logs/${ctx:x-vhost}/${ctx:x-app}/wowzastreamingengine_access.%d{yyyy-MM-dd}.log">
						<PatternLayout>
							<Header>#Version: 1.0\n#Start-Date: %d{YYY-MM-dd HH:mm:ss zzz}\n#Software: ${sys:wse-software-version}\n#Date: %d{YYY-MM-dd}\n#Fields: date\ttime\ttz\tx-event\tx-category\tx-severity\tx-status\tx-ctx\tx-comment\tx-vhost\tx-app\tx-appinst\tx-duration\ts-ip\ts-port\ts-uri\tc-ip\tc-proto\tc-referrer\tc-user-agent\tc-client-id\tcs-bytes\tsc-bytes\tx-stream-id\tx-spos\tcs-stream-bytes\tsc-stream-bytes\tx-sname\tx-sname-query\tx-file-name\tx-file-ext\tx-file-size\tx-file-length\tx-suri\tx-suri-stem\tx-suri-query\tcs-uri-stem\tcs-uri-query%n</Header>
							<Pattern>%d{yyyy-MM-dd}\t%d{HH:mm:ss}\t%d{z}\t%replace{%X{x-event}}{^$}{-}\t%replace{%X{x-category}}{^$}{-}\t%replace{%X{x-severity}}{^$}{-}\t%replace{%X{x-status}}{^$}{-}\t%replace{%X{x-ctx}}{^$}{-}\t%replace{%X{x-comment}}{^$}{-}\t%replace{%X{x-vhost}}{^$}{-}\t%replace{%X{x-app}}{^$}{-}\t%replace{%X{x-appinst}}{^$}{-}\t%replace{%X{x-duration}}{^$}{-}\t%replace{%X{s-ip}}{^$}{-}\t%replace{%X{s-port}}{^$}{-}\t%replace{%X{s-uri}}{^$}{-}\t%replace{%X{c-ip}}{^$}{-}\t%replace{%X{c-proto}}{^$}{-}\t%replace{%X{c-referrer}}{^$}{-}\t%replace{%X{c-user-agent}}{^$}{-}\t%replace{%X{c-client-id}}{^$}{-}\t%replace{%X{cs-bytes}}{^$}{-}\t%replace{%X{sc-bytes}}{^$}{-}\t%replace{%X{x-stream-id}}{^$}{-}\t%replace{%X{x-spos}}{^$}{-}\t%replace{%X{cs-stream-bytes}}{^$}{-}\t%replace{%X{sc-stream-bytes}}{^$}{-}\t%replace{%X{x-sname}}{^$}{-}\t%replace{%X{x-sname-query}}{^$}{-}\t%replace{%X{x-file-name}}{^$}{-}\t%replace{%X{x-file-ext}}{^$}{-}\t%replace{%X{x-file-size}}{^$}{-}\t%replace{%X{x-file-length}}{^$}{-}\t%replace{%X{x-suri}}{^$}{-}\t%replace{%X{x-suri-stem}}{^$}{-}\t%replace{%X{x-suri-query}}{^$}{-}\t%replace{%X{cs-uri-stem}}{^$}{-}\t%replace{%X{cs-uri-query}}{^$}{-}%n</Pattern>
							<AlwaysWriteExceptions>false</AlwaysWriteExceptions>
						</PatternLayout>
						<Policies>
							<TimeBasedTriggeringPolicy />
						</Policies>
						<DefaultRolloverStrategy>
							<Delete basePath="/opt/wowza/logs/${ctx:x-vhost}/${ctx:x-app}" maxDepth="1">
								<IfLastModified age="5d" />
							</Delete>
						</DefaultRolloverStrategy>
					</RollingFile>
				</Route>
				<Route key="">
					<CountingNoOp name="DEV_NULL" />
				</Route>
			</Routes>
		</Routing>

		<Routing name="applicationError" >
			<Routes pattern="$${ctx:x-app-context}">
				<Route>
					<RollingFile name="applicationError-${ctx:x-app-context}" fileName="/opt/wowza/logs/${ctx:x-vhost}/${ctx:x-app}/wowzastreamingengine_error.log" filePattern="/opt/wowza/logs/${ctx:x-vhost}/${ctx:x-app}/wowzastreamingengine_error.%d{yyyy-MM-dd}.log">
						<PatternLayout>
							<Header>#Version: 1.0\n#Start-Date: %d{YYY-MM-dd HH:mm:ss zzz}\n#Software: ${sys:wse-software-version}\n#Date: %d{YYY-MM-dd}\n#Fields: x-severity\tx-category\tx-event\tdate\ttime\tc-client-id\tc-ip\tc-port\tcs-bytes\tsc-bytes\tx-duration\tx-sname\tx-stream-id\tx-spos\tsc-stream-bytes\tcs-stream-bytes\tx-file-size\tx-file-length\tx-ctx\tx-comment%n</Header>
							<Pattern>%replace{%X{x-severity}}{^$}{-}\t%replace{%X{x-category}}{^$}{-}\t%replace{%X{x-event}}{^$}{-}\t%d{yyyy-MM-dd}\t%d{HH:mm:ss}\t%replace{%X{c-client-id}}{^$}{-}\t%replace{%X{c-ip}}{^$}{-}\t%replace{%X{c-port}}{^$}{-}\t%replace{%X{cs-bytes}}{^$}{-}\t%replace{%X{sc-bytes}}{^$}{-}\t%replace{%X{x-duration}}{^$}{-}\t%replace{%X{x-sname}}{^$}{-}\t%replace{%X{x-stream-id}}{^$}{-}\t%replace{%X{x-spos}}{^$}{-}\t%replace{%X{sc-stream-bytes}}{^$}{-}\t%replace{%X{cs-stream-bytes}}{^$}{-}\t%replace{%X{x-file-size}}{^$}{-}\t%replace{%X{x-file-length}}{^$}{-}\t%replace{%X{x-ctx}}{^$}{-}\t%replace{%X{x-comment}}{^$}{-}%n</Pattern>
							<AlwaysWriteExceptions>false</AlwaysWriteExceptions>
						</PatternLayout>
						<Policies>
							<TimeBasedTriggeringPolicy />
						</Policies>
						<DefaultRolloverStrategy>
							<Delete basePath="/opt/wowza/logs/${ctx:x-vhost}/${ctx:x-app}" maxDepth="1">
								<IfLastModified age="5d" />
							</Delete>
						</DefaultRolloverStrategy>
					</RollingFile>
				</Route>
				<Route key="">
					<CountingNoOp name="DEV_NULL" />
				</Route>
			</Routes>
		</Routing>

		<Routing name="applicationInstanceAccess" >
			<Routes pattern="$${ctx:x-appinst-context}">
				<Route>
					<RollingFile name="applicationInstanceAccess-${ctx:x-appinst-context}" fileName="/opt/wowza/logs/${ctx:x-vhost}/${ctx:x-app}/${ctx:x-appinst}/wowzastreamingengine_access.log" filePattern="/opt/wowza/logs/${ctx:x-vhost}/${ctx:x-app}/${ctx:x-appinst}/wowzastreamingengine_access.%d{yyyy-MM-dd}.log">
						<PatternLayout>
							<Header>#Version: 1.0\n#Start-Date: %d{YYY-MM-dd HH:mm:ss zzz}\n#Software: ${sys:wse-software-version}\n#Date: %d{YYY-MM-dd}\n#Fields: date\ttime\ttz\tx-event\tx-category\tx-severity\tx-status\tx-ctx\tx-comment\tx-vhost\tx-app\tx-appinst\tx-duration\ts-ip\ts-port\ts-uri\tc-ip\tc-proto\tc-referrer\tc-user-agent\tc-client-id\tcs-bytes\tsc-bytes\tx-stream-id\tx-spos\tcs-stream-bytes\tsc-stream-bytes\tx-sname\tx-sname-query\tx-file-name\tx-file-ext\tx-file-size\tx-file-length\tx-suri\tx-suri-stem\tx-suri-query\tcs-uri-stem\tcs-uri-query%n</Header>
							<Pattern>%d{yyyy-MM-dd}\t%d{HH:mm:ss}\t%d{z}\t%replace{%X{x-event}}{^$}{-}\t%replace{%X{x-category}}{^$}{-}\t%replace{%X{x-severity}}{^$}{-}\t%replace{%X{x-status}}{^$}{-}\t%replace{%X{x-ctx}}{^$}{-}\t%replace{%X{x-comment}}{^$}{-}\t%replace{%X{x-vhost}}{^$}{-}\t%replace{%X{x-app}}{^$}{-}\t%replace{%X{x-appinst}}{^$}{-}\t%replace{%X{x-duration}}{^$}{-}\t%replace{%X{s-ip}}{^$}{-}\t%replace{%X{s-port}}{^$}{-}\t%replace{%X{s-uri}}{^$}{-}\t%replace{%X{c-ip}}{^$}{-}\t%replace{%X{c-proto}}{^$}{-}\t%replace{%X{c-referrer}}{^$}{-}\t%replace{%X{c-user-agent}}{^$}{-}\t%replace{%X{c-client-id}}{^$}{-}\t%replace{%X{cs-bytes}}{^$}{-}\t%replace{%X{sc-bytes}}{^$}{-}\t%replace{%X{x-stream-id}}{^$}{-}\t%replace{%X{x-spos}}{^$}{-}\t%replace{%X{cs-stream-bytes}}{^$}{-}\t%replace{%X{sc-stream-bytes}}{^$}{-}\t%replace{%X{x-sname}}{^$}{-}\t%replace{%X{x-sname-query}}{^$}{-}\t%replace{%X{x-file-name}}{^$}{-}\t%replace{%X{x-file-ext}}{^$}{-}\t%replace{%X{x-file-size}}{^$}{-}\t%replace{%X{x-file-length}}{^$}{-}\t%replace{%X{x-suri}}{^$}{-}\t%replace{%X{x-suri-stem}}{^$}{-}\t%replace{%X{x-suri-query}}{^$}{-}\t%replace{%X{cs-uri-stem}}{^$}{-}\t%replace{%X{cs-uri-query}}{^$}{-}%n</Pattern>
							<AlwaysWriteExceptions>false</AlwaysWriteExceptions>
						</PatternLayout>
						<Policies>
							<TimeBasedTriggeringPolicy />
						</Policies>
						<DefaultRolloverStrategy>
							<Delete basePath="/opt/wowza/logs/${ctx:x-vhost}/${ctx:x-app}/${ctx:x-appinst}" maxDepth="1">
								<IfLastModified age="5d" />
							</Delete>
						</DefaultRolloverStrategy>
					</RollingFile>
				</Route>
				<Route key="">
					<CountingNoOp name="DEV_NULL" />
				</Route>
			</Routes>
		</Routing>

		<Routing name="applicationInstanceError" >
			<Routes pattern="$${ctx:x-appinst-context}">
				<Route>
					<RollingFile name="applicationInstanceError-${ctx:x-appinst-context}" fileName="/opt/wowza/logs/${ctx:x-vhost}/${ctx:x-app}/${ctx:x-appinst}/wowzastreamingengine_error.log" filePattern="/opt/wowza/logs/${ctx:x-vhost}/${ctx:x-app}/${ctx:x-appinst}/wowzastreamingengine_error.%d{yyyy-MM-dd}.log">
						<PatternLayout>
							<Header>#Version: 1.0\n#Start-Date: %d{YYY-MM-dd HH:mm:ss zzz}\n#Software: ${sys:wse-software-version}\n#Date: %d{YYY-MM-dd}\n#Fields: x-severity\tx-category\tx-event\tdate\ttime\tc-client-id\tc-ip\tc-port\tcs-bytes\tsc-bytes\tx-duration\tx-sname\tx-stream-id\tx-spos\tsc-stream-bytes\tcs-stream-bytes\tx-file-size\tx-file-length\tx-ctx\tx-comment%n</Header>
							<Pattern>%replace{%X{x-severity}}{^$}{-}\t%replace{%X{x-category}}{^$}{-}\t%replace{%X{x-event}}{^$}{-}\t%d{yyyy-MM-dd}\t%d{HH:mm:ss}\t%replace{%X{c-client-id}}{^$}{-}\t%replace{%X{c-ip}}{^$}{-}\t%replace{%X{c-port}}{^$}{-}\t%replace{%X{cs-bytes}}{^$}{-}\t%replace{%X{sc-bytes}}{^$}{-}\t%replace{%X{x-duration}}{^$}{-}\t%replace{%X{x-sname}}{^$}{-}\t%replace{%X{x-stream-id}}{^$}{-}\t%replace{%X{x-spos}}{^$}{-}\t%replace{%X{sc-stream-bytes}}{^$}{-}\t%replace{%X{cs-stream-bytes}}{^$}{-}\t%replace{%X{x-file-size}}{^$}{-}\t%replace{%X{x-file-length}}{^$}{-}\t%replace{%X{x-ctx}}{^$}{-}\t%replace{%X{x-comment}}{^$}{-}%n</Pattern>
							<AlwaysWriteExceptions>false</AlwaysWriteExceptions>
						</PatternLayout>
						<Policies>
							<TimeBasedTriggeringPolicy />
						</Policies>
						<DefaultRolloverStrategy>
							<Delete basePath="/opt/wowza/logs/${ctx:x-vhost}/${ctx:x-app}/${ctx:x-appinst}" maxDepth="1">
								<IfLastModified age="5d" />
							</Delete>
						</DefaultRolloverStrategy>
					</RollingFile>
				</Route>
				<Route key="">
					<CountingNoOp name="DEV_NULL" />
				</Route>
			</Routes>
		</Routing>

	</Appenders>
	<Loggers>
		<Root level="info">
			<AppenderRef ref="stdout" level="info"/>
			<AppenderRef ref="serverAccess" level="info"/>
			<AppenderRef ref="serverError" level="warn"/>
			<!-- <AppenderRef ref="serverStats" level="info"/> -->
			<!-- <AppenderRef ref="vhostAccess" level="info"/> -->
			<!-- <AppenderRef ref="vhostError" level="warn"/> -->
			<!-- <AppenderRef ref="applicationAccess" level="info"/> -->
			<!-- <AppenderRef ref="applicationError" level="warn"/> -->
			<!-- <AppenderRef ref="applicationInstanceAccess" level="info"/> -->
			<!-- <AppenderRef ref="applicationInstanceError" level="warn"/> -->
		</Root>
	</Loggers>
</Configuration>
