Windows Azure Storage (24) 启用Azure Blob日志

本文涉及的产品
日志服务 SLS,月写入数据量 50GB 1个月
简介:

  《Windows Azure Platform 系列文章目录

 

  之前有一个业务需求,客户想知道Azure Storage是否有日志功能,可以检查某个Azure Blob文件在某个时间点被删除。

  后来问了相关的同事,其实在Azure ARM Portal里面,可以开启诊断功能,监控具体的操作日志。这里写个Blog记录一下。

 

  1.我们登录Azure ARM Portal: https://portal.azure.cn

  2.选择某一个存储账户。图略

  3.在存储账户的属性里,选择监视,诊断。如下图:

  

  4.我们打开下图的监控。

  Blob聚合指标是做Blob访问流量、请求数等的监控

  Blob日志是开启Blob访问监控

  保留期:表示监控数据的保存时间。

  

 

  5.开启Blob日志后,我们可以用Azure Storage Explorer来访问日志数据。下载地址:https://go.microsoft.com/fwlink/?LinkId=708343&clcid=0x409

 

  具体使用Azure Storage Explorer我这里就不详细介绍了,具体可以参考:http://www.cnblogs.com/threestone/archive/2012/01/23/2328878.html

  

  6.日志手机需要一段时间,请稍等片刻。

  我们就可以在Azure Storage Explorer里面查看到一个Container Name,为$logs。如下图:

  

 

  7.这个$log里面的内容,都是以年、月、日、小时 (注意小时为UTC时区,北京时间为UTC+8时区,会相差8小时) 生成文件夹。如下图:

  

 

  8.我们通过Azure Storage Explorer上传一个文件1.jpg。图略。

  

  9.稍等片刻后,我们就可以看到Blob日志。

  

 

  10.把上图的log文件下载到本地硬盘。可以查看到相关信息:

  1.0;2017-10-31T12:43:12.8084195Z;PutBlob;Success;201;9;8;authenticated;leidemostorage;leidemostorage;blob;"https://leidemostorage.blob.core.chinacloudapi.cn:443/private/1.jpg";"/leidemostorage/private/1.jpg";fc6a062b-001e-0012-3845-52fb99000000;0;114.93.218.188:13156;2017-04-17;683;24912;258;0;24912;"oyiQc2iWAoyADLYdOGNnQA==";"oyiQc2iWAoyADLYdOGNnQA==";""0x8D5205CF3242308"";Tuesday, 31-Oct-17 12:43:13 GMT;;"Microsoft Azure Storage Explorer, 0.9.01, win32, Azure-Storage/2.5.0 (NODE-VERSION v7.9.0; Windows_NT 10.0.15063)";;"0dd86bf0-be39-11e7-914c-392321867fcc"

  可以看到上图中,我们通过Azure Storage Explorer上传的1.jpg图片的操作日志被完整记录下来。

 

  11.请注意,如果我们生产环境的Azure Storage,客户端访问量很大的时候,日志文件也会变得非常大。最大的甚至要几百兆。

  在如此大量的日志文件中查询相关的信息是比较困难的。

 

  12.另外Azure Storage日志文件有单独的20TB容量。容量和吞吐量都是单独计算的。不会影响Azure Storage的性能。

  


本文转自Azure Lei Zhang博客园博客,原文链接:http://www.cnblogs.com/threestone/p/7756568.html,如需转载请自行联系原作者


相关实践学习
日志服务之使用Nginx模式采集日志
本文介绍如何通过日志服务控制台创建Nginx模式的Logtail配置快速采集Nginx日志并进行多维度分析。
目录
相关文章
|
2天前
【Azure Policy】分享Policy实现对Azure Activity Log导出到Log A workspace中
在Policy Rule部分中,选择资源的类型为 "Microsoft.Resources/subscriptions", 效果使用 DeployIfNotExists (如果不存在,则通过修复任务进行修正。 在 existenceCondition 条件中,如果当前订阅已经启用了 diagnostic setting并且输出日志到同一个Log A workspace,表示满足Policy要求,不需要进行修正。 在 deployment 中,使用了 ARM 模板, 为订阅添加Diagnostic Setting并且所有的日志Category均启用。
|
13天前
|
Kubernetes 数据安全/隐私保护 容器
【Azure APIM】APIM Self-Hosted网关中,添加网关日志以记录请求头信息(Request Header / Response Header)
【Azure APIM】APIM Self-Hosted网关中,添加网关日志以记录请求头信息(Request Header / Response Header)
|
13天前
[Azure Developer]把Azure Function中ILogger对象静态化为静态方法提供日志记录
[Azure Developer]把Azure Function中ILogger对象静态化为静态方法提供日志记录
|
13天前
【Azure Function & Application Insights】在Azure Function的日志中,发现DrainMode mode enabled Traces。它是什么意思呢?
【Azure Function & Application Insights】在Azure Function的日志中,发现DrainMode mode enabled Traces。它是什么意思呢?
|
13天前
|
PHP Windows
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
|
13天前
|
网络安全 API 数据安全/隐私保护
【Azure App Service】.NET代码实验App Service应用中获取TLS/SSL 证书 (App Service Windows)
【Azure App Service】.NET代码实验App Service应用中获取TLS/SSL 证书 (App Service Windows)
|
13天前
|
存储 大数据 索引
【Azure Contianer Apps】在云上使用容器应用时收集日志遇见延迟问题
【Azure Contianer Apps】在云上使用容器应用时收集日志遇见延迟问题
|
13天前
【Azure Function & Application Insights】调用Function上传和下载文件,有时候遇见大于1MB的文件的日志没有记录在Application Insights中
【Azure Function & Application Insights】调用Function上传和下载文件,有时候遇见大于1MB的文件的日志没有记录在Application Insights中
|
13天前
|
网络安全
【Azure Service Bus】启用诊断日志来获取客户端访问Azure Service Bus的IP地址 [2024-03-26 实验结果失败]
【Azure Service Bus】启用诊断日志来获取客户端访问Azure Service Bus的IP地址 [2024-03-26 实验结果失败]
|
13天前
|
存储
【Azure Log A workspace】Azure上很多应用日志收集到Log A workspace后如何来分别各自的占比呢?
【Azure Log A workspace】Azure上很多应用日志收集到Log A workspace后如何来分别各自的占比呢?
下一篇
DDNS