Skip to content

Commit

Permalink
[collector]handle sensitive information such as account and password …
Browse files Browse the repository at this point in the history
…in log (#159)
  • Loading branch information
tomsun28 authored May 29, 2022
1 parent 4b32c0d commit 1906af2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import lombok.Builder;
import lombok.Data;
import lombok.ToString;

import java.util.Objects;

/**
* 缓存key唯一标识符
Expand All @@ -11,7 +12,6 @@
*/
@Data
@Builder
@ToString
public class CacheIdentifier {

private String ip;
Expand All @@ -22,4 +22,12 @@ public class CacheIdentifier {

private String password;

@Override
public String toString() {
return "CacheIdentifier {" +
"ip='" + ip + '\'' +
", port='" + port + '\'' +
", username+password=>hash='" + Objects.hash(username, password) + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public void addCache(Object key, Object value) {
public Optional<Object> getCache(Object key, boolean refreshCache) {
Long[] cacheTime = timeoutMap.get(key);
if (cacheTime == null || cacheTime.length != CACHE_TIME_LENGTH) {
log.warn("[cache] not hit the cache, key {}.", key);
log.info("[cache] not hit the cache, key {}.", key);
return Optional.empty();
}
if (cacheTime[0] + cacheTime[1] < System.currentTimeMillis()) {
Expand Down

0 comments on commit 1906af2

Please sign in to comment.