簡體   English   中英

Google Drive API Java客戶端庫日志記錄

[英]Google Drive API Java Client Library Logging

Google Drive API Java客戶端是否記錄傳出的REST-HTTP請求和傳入的REST-HTTP響應?

這對於調試API調用以確保正在處理正確的請求和響應非常重要。

有沒有一種方法可以打開日志記錄以查看通過DRIVE API調用發送給Google的請求和響應?

謝謝

它使用java.util.logging.Logger記錄HTTP請求和響應的詳細信息,包括URL,標頭和內容。

通常,使用logging.properties文件管理日志記錄。 例如:

# Properties file which configures the operation of the JDK logging facility.
# The system will look for this config file to be specified as a system property:
# -Djava.util.logging.config.file=${project_loc:googleplus-simple-cmdline-sample}/logging.properties

# Set up the console handler (uncomment "level" to show more fine-grained messages)
handlers = java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level = CONFIG

# Set up logging of HTTP requests and responses (uncomment "level" to show)
com.google.api.client.http.level = CONFIG

有關更多信息,請參見日志記錄

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM