Apache Log4j is used by the Knox Gateway, for detailed information on extending or setting log values see Logging Practices. The following table provides a description of the log properties available for troubleshooting on the Knox Gateway:
Table 12.1. Knox Loggers
Logger | Description |
---|---|
log4j.logger.org.apache.hadoop.gateway | Sets the log level for the Apache Knox Gateway logger. |
log4j.logger.org.eclipse.jetty | Sets the log level for the Apache Knox Gateway logger. |
log4j.logger.org.apache.shiro | Sets the log level for the Apache Shiro authentication provider. Use this logger when troubleshooting LDAP authentication issues. |
log4j.logger.org.apache.http | Sets the log level for HTTP connections. |
log4j.logger.org.apache.http.client | Increase to capture data from HTTP requests. |
log4j.logger.org.apache.http.headers | Increase to capture header information. |
log4j.logger.org.apache.http.wire | Increase to capture data from server HTTP responses. Produces a large amount of data, should only be used for debugging. |
Use the following settings to enable header and context logging:
log4j.logger.org.apache.http=DEBUG log4j.logger.org.apache.http.wire=ERROR
Note These settings produce large amount of data in the logs and should only be used while actively debugging.
Use the following settings to enable full wire and context logging:
log4j.logger.org.apache.http=DEBUG
Use the following settings to enable LDAP provider logging:
log4j.logger.org.apache.shiro=DEBUG log4j.logger.org.apache.http.headers=DEBUG
Use the following settings to enable context logging for connection management/request execution"
log4j.logger.org.apache.http.client=DEBUG
Note that the default configuration for Log4J is very inefficient as it causes all the logging information to be generated but not actually sent anywhere. The Log4J manual is the best reference for how to configure Log4J. It is available at here.