Skip to content

Commit

Permalink
Acceslog: camelCase requestTime (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
kingster authored Aug 12, 2024
1 parent 2c4a386 commit d778de3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private Map<String,Object> getValueMap() {

if (requestTime != null) {
String localDate = OffsetDateTime.ofInstant(Instant.ofEpochMilli(requestTime), ZoneId.systemDefault()).format(DateTimeFormatter.ISO_DATE_TIME);
params.put("request-time", localDate);
params.put("requestTime", localDate);
}
params.put("thread", Thread.currentThread().getName());
if (userContext != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ public class GrpcFilterConfig {
private boolean enableAccessLogs = true;

@JsonProperty("accessLogFormat")
private String accessLogFormat = "{clientIp} - [{request-time}] \"{method} {resourcePath}\" {responseStatus} {contentLength} {responseTime}";
private String accessLogFormat = "{clientIp} - [{requestTime}] \"{method} {resourcePath}\" {responseStatus} {contentLength} {responseTime}";
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ public class HttpFilterConfig {
private boolean enableAccessLogs = true;

@JsonProperty("accessLogFormat")
private String accessLogFormat = "{clientIp} - [{request-time}] \"{method} {resourcePath} {protocol}\" {responseStatus} {contentLength} {responseTime} \"{referer}\" \"{userAgent}\"";
private String accessLogFormat = "{clientIp} - [{requestTime}] \"{method} {resourcePath} {protocol}\" {responseStatus} {contentLength} {responseTime} \"{referer}\" \"{userAgent}\"";

}
4 changes: 2 additions & 2 deletions examples/src/main/resources/hello_world_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Grpc:
server.executorThreads : 4
filterConfig:
enableAccessLogs: true
accessLogFormat: '{clientIp} - [{request-time}] "{method} {resourcePath} GRPC" {responseStatus} {contentLength} {responseTime} "-" "-"'
accessLogFormat: '{clientIp} - [{requestTime}] "{method} {resourcePath} GRPC" {responseStatus} {contentLength} {responseTime} "-" "-"'

Dashboard:
service.port: 9999
Expand All @@ -21,7 +21,7 @@ Api:
healthcheck.path: "/elb-healthcheck"
filterConfig:
enableAccessLogs: true
accessLogFormat: '{clientIp} - [{request-time}] "{method} {resourcePath} {protocol}" {responseStatus} {contentLength} {responseTime} "{referer}" "{userAgent}"'
accessLogFormat: '{clientIp} - [{requestTime}] "{method} {resourcePath} {protocol}" {responseStatus} {contentLength} {responseTime} "{referer}" "{userAgent}"'

Tracing:
collector.endpoint: http://localhost:9411/api/v2/spans
Expand Down

0 comments on commit d778de3

Please sign in to comment.