Wowza Streaming Engine™ media server software 4.8.8.01 and later uses the Apache Log4j 2 Java logging framework for logging. You can enable debug logging for verbose log messages, and you can use filtering to enable debug logging for a specific Java package or class.
Note: The instructions in this article apply to Wowza Streaming Engine 4.8.8.01 and later.
Enable debug logging
You can enable debug logging for all Wowza Streaming Engine log files.
- Navigate to [install-dir]/conf/ and open log4j2-config.xml in a text editor.
- In the <Loggers> block, set <Root level> to debug, and set the level attribute for the stdout and serverAccess appenders to debug.
<Loggers> <Root level="debug"> <AppenderRef ref="stdout" level="debug"/> <AppenderRef ref="serverAccess" level="debug"/> <AppenderRef ref="serverError" level="warn"/> <!-- <AppenderRef ref="vhostAccess" level="info"/> --> <!-- <AppenderRef ref="vhostError" level="warn"/> --> <!-- <AppenderRef ref="applicationAccess" level="info"/> --> <!-- <AppenderRef ref="applicationError" level="warn"/> --> </Root> </Loggers>
Enable debug logging per Java package or class
Using the Log4J 2 DynamicThresholdFilter, you can enable logging per Java package or class. The following ThreadContext map values are used to filter:
Field name | Description |
---|---|
x-class-fqcn | Fully qualified Java class name, including the package name |
x-class-name | Class name |
x-class-packagename | Class package name only |
As an example, do the following for enabling debug logging per Java package:
- Navigate to [install-dir]/conf/ and open log4j2-config.xml in a text editor.
- Modify the <Loggers> block to set <Root level> to debug and remove the level attribute from the stdout and serverAccess appenders.
<Loggers> <Root level="debug"> <AppenderRef ref="stdout" /> <AppenderRef ref="serverAccess" /> <AppenderRef ref="serverError" level="warn"/> <!-- <AppenderRef ref="vhostAccess" level="info"/> --> <!-- <AppenderRef ref="vhostError" level="warn"/> --> <!-- <AppenderRef ref="applicationAccess" level="info"/> --> <!-- <AppenderRef ref="applicationError" level="warn"/> --> </Root> </Loggers>
- Edit the following XML to filter for your preferred package names, and add it to the <Console> block and the serverAccess <RollingFile> block. This example filters on Java package names com.wowza.wms.vhost and com.wowza.wms.util.
<Filters> <DynamicThresholdFilter key="x-class-packagename" defaultThreshold="INFO" onMatch="ACCEPT" onMismatch="DENY"> <KeyValuePair key="com.wowza.wms.vhost" value="DEBUG"/> <KeyValuePair key="com.wowza.wms.util" value="DEBUG"/> </DynamicThresholdFilter> </Filters>