SDK 3.2 Printing TRACE & DEBUG logs by default

Description

Hi, 

While trying to update the Java SDK to 3.2.0 on the playground, I find that the logs are turned on by default in 3.2.0 vs 3.1.3

Sample log
[DEBUG] (cb-events) [com.couchbase.core][DnsSrvLookupDisabledEvent] DNS SRV lookup disabled (enabled on the env: true, valid host: false)
[DEBUG] (cb-events) [com.couchbase.core][ReconfigurationCompletedEvent][7778us] Reconfiguration attempt completed. {"coreId":"0x663bf28800000001"}
[ INFO] (cb-events) [com.couchbase.core][CoreCreatedEvent] {"clientVersion":"3.2.0","clientGitHash":"${buildNumber}","coreVersion":"2.2.0","coreGitHash":"${buildNumber}","userAgent":"couchbase-java/3.2.0 (Linux 5.10.25-linuxkit amd64; OpenJDK 64-Bit Server VM 16.0.1+9)","maxNumRequestsInRetry":32768,"ioEnvironment":{"nativeIoEnabled":true,"eventLoopThreadCount":3,"eventLoopGroups":["EpollEventLoopGroup"]},"ioConfig":{"captureTraffic":[],"mutationTokensEnabled":true,"networkResolution":"auto","dnsSrvEnabled":true,"tcpKeepAlivesEnabled":true,"tcpKeepAliveTimeMs":60000,"configPollIntervalMs":2500,"kvCircuitBreakerConfig":"disabled","queryCircuitBreakerConfig":"disabled","viewCircuitBreakerConfig":"disabled","searchCircuitBreakerConfig":"disabled","analyticsCircuitBreakerConfig":"disabled","managerCircuitBreakerConfig":"disabled","eventingCircuitBreakerConfig":"disabled","numKvConnections":1,"maxHttpConnections":12,"idleHttpConnectionTimeoutMs":4500,"configIdleRedialTimeoutMs":300000,"memcachedHashingStrategy":"StandardMemcachedHashingStrategy"},"compressionConfig":{"enabled":true,"minRatio":0.83,"minSize":32},"securityConfig":{"tlsEnabled":false,"nativeTlsEnabled":true,"hostnameVerificationEnabled":true,"hasTrustCertificates":false,"trustManagerFactory":null,"ciphers":[]},"timeoutConfig":{"kvMs":2500,"kvDurableMs":10000,"managementMs":75000,"queryMs":75000,"viewMs":75000,"searchMs":75000,"analyticsMs":75000,"connectMs":10000,"disconnectMs":10000,"eventingMs":75000},"loggerConfig":{"customLogger":null,"fallbackToConsole":true,"disableSlf4j":false,"loggerName":"CouchbaseLogger","diagnosticContextEnabled":false},"orphanReporterConfig":{"emitIntervalMs":10000,"sampleSize":10,"queueLength":1024,"enabled":true},"thresholdLoggingTracerConfig":{"enabled":true,"emitIntervalMs":10000,"sampleSize":10,"queueLength":1024,"kvThresholdMs":500,"queryThresholdMs":1000,"searchThresholdMs":1000,"analyticsThresholdMs":1000,"viewThresholdMs":1000},"loggingMeterConfig":{"enabled":true,"emitIntervalMs":600000},"retryStrategy":"BestEffortRetryStrategy","requestTracer":"ThresholdLoggingTracer","meter":"LoggingMeter","numRequestCallbacks":0} {"coreId":"0x663bf28800000001","seedNodes":[

{"address":"127.0.0.1"}

]}
[ INFO] (cb-events) [com.couchbase.node][NodeConnectedEvent] Node connected {"coreId":"0x663bf28800000001","managerPort":"8091","remote":"127.0.0.1"}
[DEBUG] (cb-events) [com.couchbase.service][ServiceConnectInitiatedEvent] Starting to connect service with 1 minimum endpoints {"coreId":"0x663bf28800000001","remote":"127.0.0.1:11210","type":"KV"}
[DEBUG] (cb-events) [com.couchbase.endpoint][EndpointStateChangedEvent] Endpoint changed state from DISCONNECTED to CONNECTING {"circuitBreaker":"DISABLED","coreId":"0x663bf28800000001","remote":"127.0.0.1:11210","type":"KV"}
.....
[TRACE] (cb-events) [com.couchbase.service][ServiceAddIgnoredEvent] Service not added to Node. Reason: ALREADY_ADDED {"coreId":"0x663bf28800000001","managerPort":"8091","remote":"127.0.0.1"}
[DEBUG] (cb-events) [com.couchbase.core][ReconfigurationCompletedEvent][18ms] Reconfiguration attempt completed. {"coreId":"0x663bf28800000001"}
[ INFO] (cb-events) [com.couchbase.core][BucketOpenedEvent][391ms] Opened bucket "travel-sample" {"coreId":"0x663bf28800000001"}
GetResult{content=

{"id":10,"type":"airline","name":"40-Mile Air","iata":"Q5","icao":"MLA","callsign":"MILE-AIR","country":"United States"}

, flags=0x0, cas=0x169639cd55e40001, expiry=Optional.empty}
After trying to disable logs in the runtime, we are still getting debug logs from the cb-events.
javac -cp .:`cat /home/play/hello/classpath.txt` code.java
java -cp .:`cat /home/play/hello/classpath.txt` -Droot.log.level=INFO Program

 

Is it possible to disable these logs while running the program?

Environment

None

Gerrit Reviews

None

Release Notes Description

None

Attachments

1
  • 29 Jul 2021, 03:48 PM

Activity

Show:

Michael Nitschinger July 30, 2021 at 5:07 AM

Yes, this identified as a regression - thanks for raising it. We'll get it reverted for 3.2.1.

Dima Chechetkin July 29, 2021 at 3:48 PM
Edited

https://github.com/couchbase/couchbase-jvm-clients/compare/java-client-3.1.6...java-client-3.2.0#diff-edd76ec743bd22bcb7de31e9d9f345d0e2b79bcfb74db07c686dbda620e4997eL29 (LoggerConfig.java:29) – enables automatic fallback to ConsoleLogger in 3.2.

 

ConsoleLogger has its `is<Logginglevel>Enabled` methods hard-coded to return `true`:

 

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

CVSS/Severity

Medium

Story Points

Fix versions

Affects versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created July 29, 2021 at 12:41 PM
Updated August 2, 2021 at 1:48 PM
Resolved August 2, 2021 at 1:48 PM
Instabug