Provide debug options in Java SDK Client to monitor the outgoing external calls for OCI resources

Đang mở
#644 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
api

Hướng nghiên cứu

Bắt đầu với bmc-common/src/main/java/com/oracle/bmc/http/internal/ClientCall.java, đặc biệt là callSync và cách sử dụng logger hiện có của nó. Theo dõi cách các lệnh gọi tài nguyên OCI gửi đi đến được lớp này và cách cấu hình các cấp độ logging. Hoàn tất có nghĩa là các thông báo debug về URL và phương thức HTTP có sẵn cho các lệnh gọi đó khi cấp độ log phù hợp được bật.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

SDK

We need the ability to monitor the outgoing external calls for OCI resources such as OCI streams, Object storage, and secrets etc. I'm creating this issue as an enhancement request to add debug messages containing HTTP URL and method for the external calls. These debug messages can be enabled by changing the log level.

As an experiment, I modified the com.oracle.bmc.http.internal.ClientCall class in "bmc-common" module, and added a debug/print message in the callSync method to print the URI and method of the httpRequest. This was helpful to see the external calls. Following is the file and the "callSync"call method that I modified. Thanks.

File modified - https://bitbucket.oci.oraclecorp.com/projects/SDK/repos/java-sdk/browse/bmc-common/src/main/java/com/oracle/bmc/http/internal/ClientCall.java

Modified "callSync" method -

public RESP callSync() {

    waiterScheduler = WaiterScheduler.SYNC;

    SyncFutureWaiter futureWaiter = new SyncFutureWaiter();

    offloadExecutor = futureWaiter;

    httpRequest = httpRequest.offloadExecutor(offloadExecutor);


    logger.debug("DEBUG>> httpRequest is " + httpRequest);



    try {

        if (httpRequest != null && httpRequest.uri() != null)

{ logger.debug("DEBUG>> URL is " + httpRequest.uri().toString()); }

        if (httpRequest != null && httpRequest.method() != null)

{ logger.debug("DEBUG>> Request method is " + httpRequest.method().toString()); }
return futureWaiter.listenForResult(callAsync0(null));

    } catch (BmcException e)

{ throw e; }
catch (Throwable e)

{ throw BmcException.createClientSide("Unknown error", e, null, buildServiceDetails()); }
}

}

Ngôn ngữ chính
Java
Star
243
Fork
171
Merge trung bình
5 phút
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của oracle/oci-java-sdk

Tất cả issue của oracle/oci-java-sdk

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.