繁体   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