Skip to content

Commit 3e44574

Browse files
committed
Remove excessive logs and tweak condition
1 parent e0a8426 commit 3e44574

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

dd-java-agent/appsec/src/main/java/com/datadog/appsec/api/security/ApiSecuritySamplerImpl.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,19 @@ public ApiSecuritySamplerImpl(
5454
public boolean preSampleRequest(final @Nonnull AppSecRequestContext ctx) {
5555
final String route = ctx.getRoute();
5656
if (route == null) {
57-
log.debug("Route is null, skipping API security sampling");
5857
return false;
5958
}
6059
final String method = ctx.getMethod();
6160
if (method == null) {
62-
log.debug("Method is null, skipping API security sampling");
6361
return false;
6462
}
6563
final int statusCode = ctx.getResponseStatus();
66-
if (statusCode == 0) {
67-
log.debug("Status code is 0, skipping API security sampling");
64+
if (statusCode <= 0) {
6865
return false;
6966
}
7067
long hash = computeApiHash(route, method, statusCode);
7168
ctx.setApiSecurityEndpointHash(hash);
7269
if (!isApiAccessExpired(hash)) {
73-
log.debug("API security sampling is not required for this request");
7470
return false;
7571
}
7672
if (counter.tryAcquire()) {

dd-java-agent/appsec/src/main/java/com/datadog/appsec/api/security/AppSecSpanPostProcessor.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ public void process(@Nonnull AgentSpan span, @Nonnull BooleanSupplier timeoutChe
4141
}
4242

4343
if (!ctx.isKeepOpenForApiSecurityPostProcessing()) {
44-
log.debug("Request context not marked for API security post-processing");
4544
return;
4645
}
4746

0 commit comments

Comments
 (0)