Log 404 error of azure blob

Luca 1 Reputation point
2021-06-14T14:52:47.74+00:00

I would like to activate a log that records only 404 errors, on an image azure blob, and if it's possible access the log via http.
That is: when I request an image from url and the image is not on the blob, I want that in the log is written the url of the request that sent in error 404.
I tried looking for how to enable logs or view but I failed. Please help me, thanks

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,575 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sumarigo-MSFT 44,906 Reputation points Microsoft Employee
    2021-06-14T15:24:31.467+00:00

    @Luca Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    Are you referring to How Enable $logs for Azure Blob storage: https://learn.microsoft.com/en-us/azure/storage/common/manage-storage-analytics-logs?tabs=azure-portal ,

    We have feature which lists the storage service operations and status messages that are recorded by Storage Analytics. Requests made by Storage Analytics itself, such as log creation or deletion, are not logged. A full list of the logged data is documented in the Storage Analytics Logged Operations and Status Messages and Storage Analytics Log Format topics.. If not please correct me?

    Storage Analytics logging is not enabled by default for your storage account. You can enable it in the Azure portal or by using PowerShell, or Azure CLI. For step-by-step guidance, see Enable and manage Azure Storage Analytics logs (classic).

    The diagnostics logs are saved in a blob container named $logs in your storage account. You can view the log data using a storage explorer like the Microsoft Azure Storage Explorer, or programmatically using the storage client library or PowerShell.

    For information about accessing the logs container, see Storage analytics logging.

    Additional information: Monitor, diagnose, and troubleshoot Microsoft Azure Storage

    Hope this helps!

    Kindly let us know if the above helps or you need further assistance on this issue.

    ----------------------------------------------------------------------------------------------------------------------------------------

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

  2. Luca 1 Reputation point
    2021-06-22T10:45:12.75+00:00

    108172-immagine-2021-06-22-121011.png

    108143-immagine-2021-06-22-221011.png

    108135-immagine-2021-06-22-122441.png

    108105-immagine-2021-06-22-124259.png

    Thank you @Sumarigo-MSFT for your answer.
    It was certainly useful. However in the logs I can't see what I need. In the logs I see the various calls to the images, but I can't find the images that went into error 404. See this example in the images: the website gives me a 404 error for some images, however those images cannot be found in the logs. I opened all the files in folder 09 (because I opened that site at that time) but I can't find these images. How can I find them in the logs? I urge you to look at the pictures of my log settings.

    Another question: in the logs I always see a 200 (I think it is the response status of the server), however if we take the second example, the image goes into error 400, because it is an image that exists on the blob but is corrupt I think, and yet Error 200 is logged in the log. Why?

    How do I get 404 responses to be shown in the logs?

    Thank you

    These are two rows of the log: note that it is always 200 but the second example leads to a 400 error if you inspect the page

    1.0;2021-06-22T09:04:55.6797228Z;GetBlob;AnonymousSuccess;200;10;10;anonymous;;salesresource;blob;"https://salesresource.blob.core.windows.net:443/images/3A/C08/thumb/M9160C.jpg";"/salesresource/images/3A/C08/thumb/M9160C.jpg";fb575ddf-001e-0062-3545-67608e000000;0;10.116.0.53:41416;2009-09-19;137;0;286;4590;0;;;"0x8D91F6C32513DAB";Tuesday, 25-May-21 10:59:41 GMT;;;;

    1.0;2021-06-22T09:06:57.7269329Z;GetBlob;AnonymousSuccess;200;8;8;anonymous;;salesresource;blob;"https://salesresource.blob.core.windows.net:443/images/3A/N04/all/BQ5671-018-PHSUH000.jpg";"/salesresource/images/3A/N04/all/BQ5671-018-PHSUH000.jpg";6735f130-401e-00a9-1145-67f2be000000;0;10.116.0.53:42776;2009-09-19;148;0;283;0;0;;;"0x8D8024BCEC3B401";Wednesday, 27-May-20 14:39:48 GMT;;;;

    108116-immagine-2021-06-22-124313.png

    108117-immagine-2021-06-22-124323.png

    108164-immagine-2021-06-22-124334.png

    0 comments No comments