Skip to content

Commit

Permalink
move logger middleware docs to interface
Browse files Browse the repository at this point in the history
  • Loading branch information
jenschude committed Dec 20, 2022
1 parent dc3c443 commit a12d68d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
Expand Up @@ -3,10 +3,24 @@

import java.util.Map;

import io.vrap.rmf.base.client.ApiHttpHeaders;

import org.slf4j.event.Level;

/**
* Middleware instrumenting the {@link InternalLogger}
*
* <p>Responses are logged by default with {@link Level#INFO}.
* In case of an {@link ApiHttpHeaders#X_DEPRECATION_NOTICE deprecation} header the notice will be logged with {@link Level#INFO}
* Any exception will be logged with {@link Level#ERROR}</p>
*
* <p>The response, deprecation and error logger levels are configurable. Additionally, a map can be provided with the key a throwable type class
* and the value of the log level the exception should be logged with</p>
*
* <p>The middleware logs with debug also the request and the whole response including headers. With trace level the request and response will
* be logged pretty printed.</p>
*
* <p>All log events are written as lambda function to avoid rendering the message if the respective level is not enabled.</p>
*/
public interface InternalLoggerMiddleware extends Middleware {

Expand Down
Expand Up @@ -17,18 +17,6 @@

/**
* <p>Default implementation for the {@link InternalLoggerMiddleware}</p>
*
* <p>Responses are logged by default with {@link Level#INFO}.
* In case of an {@link ApiHttpHeaders#X_DEPRECATION_NOTICE deprecation} header the notice will be logged with {@link Level#INFO}
* Any exception will be logged with {@link Level#ERROR}</p>
*
* <p>The response, deprecation and error logger levels are configurable. Additionally, a map can be provided with the key a throwable type class
* and the value of the log level the exception should be logged with</p>
*
* <p>The middleware logs with debug also the request and the whole response including headers. With trace level the request and response will
* be logged pretty printed.</p>
*
* <p>All log events are written as lambda function to avoid rendering the message if the respective level is not enabled.</p>
*/
class InternalLoggerMiddlewareImpl implements InternalLoggerMiddleware {
private static final Logger classLogger = LoggerFactory.getLogger(InternalLoggerMiddlewareImpl.class);
Expand Down

0 comments on commit a12d68d

Please sign in to comment.