Skip to content

Commit

Permalink
extended AccessLogHttpFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
ajay-jalgaonkar committed Jul 24, 2024
1 parent 7122c2e commit f29d4a3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ public class AccessLogGrpcFilter<R extends GeneratedMessageV3,
S extends GeneratedMessageV3> extends GrpcFilter<R,S> {
private long startTime = 0;
private RequestParams<R, Metadata> requestParams;
@Override
public GrpcFilter<R,S> getInstance(){
return new AccessLogGrpcFilter<>();
}

@Override
public void doProcessRequest(RequestParams<R, Metadata> requestParams) {
Expand All @@ -41,4 +37,26 @@ public void doProcessResponse(ResponseParams<S> responseParams) {
.append(System.currentTimeMillis()-startTime);
info("access-log", sb.toString());
}

@Override
public GrpcFilter<R,S> getInstance(){
return new AccessLogGrpcFilter<>();
}

public long getStartTime() {
return startTime;
}

public void setStartTime(long startTime) {
this.startTime = startTime;
}

public RequestParams<R, Metadata> getRequestParams() {
return requestParams;
}

public void setRequestParams(RequestParams<R, Metadata> requestParams) {
this.requestParams = requestParams;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,20 @@ public void doProcessResponse(ResponseParams<ServletResponse> response) {

@Override
public void init(FilterConfig filterConfig) throws ServletException {}

public long getStartTime() {
return startTime;
}

public void setStartTime(long startTime) {
this.startTime = startTime;
}

public StringBuilder getSb() {
return sb;
}

public void setSb(StringBuilder sb) {
this.sb = sb;
}
}

0 comments on commit f29d4a3

Please sign in to comment.