1515import com .appsmith .server .services .SessionUserService ;
1616import com .appsmith .server .services .UserService ;
1717import lombok .RequiredArgsConstructor ;
18+ import lombok .extern .slf4j .Slf4j ;
1819import org .apache .commons .codec .digest .DigestUtils ;
1920import org .apache .commons .lang3 .StringUtils ;
2021import reactor .core .publisher .Mono ;
2526import static java .lang .Boolean .TRUE ;
2627
2728@ RequiredArgsConstructor
29+ @ Slf4j
2830public 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