L - the type of the structured log representationpublic abstract class StructuredLoggingService<L> extends SimpleDecoratingHttpService
| Modifier | Constructor and Description |
|---|---|
protected |
StructuredLoggingService(HttpService delegate,
StructuredLogBuilder<L> logBuilder)
Creates a new
StructuredLoggingService. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
close()
Cleanup resources which were opened for logging.
|
HttpResponse |
serve(ServiceRequestContext ctx,
HttpRequest req)
Serves an incoming
Request. |
void |
serviceAdded(ServiceConfig cfg)
Invoked when this service has been added to a
Server with the specified
configuration. |
protected abstract void |
writeLog(RequestLog log,
L structuredLog)
Writes given
structuredLog to the underlying system. |
shouldCachePathas, delegate, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdecorate, decorateas, decorate, shouldCachePathprotected StructuredLoggingService(HttpService delegate, StructuredLogBuilder<L> logBuilder)
StructuredLoggingService.delegate - the HttpService being decoratedlogBuilder - an instance of StructuredLogBuilder which is used to construct an entry of
structured logpublic void serviceAdded(ServiceConfig cfg) throws Exception
ServiceServer with the specified
configuration. Please note that this method can be invoked more than once if this service
has been added more than once.serviceAdded in interface Service<HttpRequest,HttpResponse>serviceAdded in class DecoratingService<HttpRequest,HttpResponse,HttpRequest,HttpResponse>Exceptionpublic HttpResponse serve(ServiceRequestContext ctx, HttpRequest req) throws Exception
ServiceRequest.protected abstract void writeLog(RequestLog log, L structuredLog)
structuredLog to the underlying system.log - the RequestLog which is a source of constructed structuredLogstructuredLog - the content of a structuredLogprotected void close()
Copyright © 2020 LeanCloud. All rights reserved.