Skip to content

Commit 5394bfa

Browse files
committed
Log with warn level
1 parent e6c718c commit 5394bfa

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UsagePulseServiceCEImpl.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import com.appsmith.server.services.SessionUserService;
1616
import com.appsmith.server.services.UserService;
1717
import lombok.RequiredArgsConstructor;
18+
import lombok.extern.slf4j.Slf4j;
1819
import org.apache.commons.codec.digest.DigestUtils;
1920
import org.apache.commons.lang3.StringUtils;
2021
import reactor.core.publisher.Mono;
@@ -25,6 +26,7 @@
2526
import static java.lang.Boolean.TRUE;
2627

2728
@RequiredArgsConstructor
29+
@Slf4j
2830
public class UsagePulseServiceCEImpl implements UsagePulseServiceCE {
2931

3032
private final UsagePulseRepository repository;
@@ -50,7 +52,10 @@ public Mono<UsagePulse> createPulse(UsagePulseDTO usagePulseDTO) {
5052
if (null == usagePulseDTO.getViewMode()) {
5153
return Mono.error(new AppsmithException(AppsmithError.INVALID_PARAMETER, FieldName.VIEW_MODE));
5254
} else if (FALSE.equals(usagePulseDTO.getViewMode()) && usagePulseDTO.getAnonymousUserId() != null) {
53-
// Anonymous users shouldn't hit edit mode pulses; ignore silently to avoid noisy logs.
55+
log.warn(
56+
"Ignoring usage pulse: anonymous user attempted edit-mode pulse. viewMode={}, hasAnonymousId={}",
57+
usagePulseDTO.getViewMode(),
58+
usagePulseDTO.getAnonymousUserId() != null);
5459
return Mono.empty();
5560
}
5661

@@ -76,7 +81,7 @@ public Mono<UsagePulse> createPulse(UsagePulseDTO usagePulseDTO) {
7681

7782
if (user.isAnonymous()) {
7883
if (StringUtils.isBlank(usagePulseDTO.getAnonymousUserId())) {
79-
// Anonymous usage pulses without an identifier are ignored to avoid noisy logs.
84+
log.warn("Ignoring usage pulse: missing anonymous user id for anonymous user.");
8085
return Mono.empty();
8186
}
8287
usagePulse.setIsAnonymousUser(true);

0 commit comments

Comments
 (0)