【发布时间】:2020-04-26 20:17:30
【问题描述】:
我想使用 Azure blob 存储在客户端站点记录请求/响应 Java sdk(ver12)。
在微软在线文档 [https://docs.microsoft.com/en-us/rest/api/storageservices/client-side-logging-with-the-microsoft-azure-storage-sdk-for-java],我找到了这个示例代码。
// Set logging off by default.
OperationContext.setLoggingEnabledByDefault(false);
OperationContext ctx = new OperationContext();
ctx.setLoggingEnabled(true);
// Create an operation to add a new customer to the people table.
TableOperation insertCustomer1 = TableOperation.insertOrReplace(customer1);
// Submit the operation to the table service.
table.execute(insertCustomer1, null, ctx);
但它不起作用。 OperationContext 在库中找不到。可能是旧版本示例。
希望有人能给我一个示例代码,谢谢。
【问题讨论】: