locked
Unable to disable storage account logging in an obvious way RRS feed

  • Question

  • It doesn't look like there is a way to disable logging except via the portal.

    I can update the settings via the "az storage logging update --log rwd --services b --retention 7 --account-name example123" docs are here https://docs.microsoft.com/en-us/cli/azure/storage/logging?view=azure-cli-latest#az-storage-logging-update

    I also do not see an obvious way to disable it via the rest api:

    https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-service-properties

    I can change this setting it via the portal under "Storage Account > Monitoring (classic) > Diagnostic Settings (classic)" and changing the "Status" switch to "Off" or "On" as well as modify any other diagnostic settings.

    The closest thing I found would be a command like this

    az storage blob service-properties update --account-name example123 --set logging.retentionPolicy.days=1 logging.read=false logging.write=false logging.delete=false



    Is there something I've overlooked?
    Wednesday, January 29, 2020 7:14 PM

All replies

  • The Python SDK does provide a way to disable or narrow the logging on storage accounts, an example as bellow: 

    logging.getLogger("azure.storage.common.storageclient").setLevel(logging.WARNING)
    

    I'd recommend checking an identical post which was posted in StackOverflow: https://stackoverflow.com/questions/52051501/azure-blob-storage-sdk-switch-off-logging

    Let me know if this helps.

    Thanks,

    Adam

     
    Wednesday, January 29, 2020 11:10 PM
  • Is there any update on the issue?

    If the suggested answer helped for your issue, do click on "Mark as Answer" and “Vote as Helpful” on the post that helps you, this can be beneficial to other community members.

    Thursday, February 6, 2020 3:21 AM
  • @BTPhoneHome Is there any update on the issue?

    If the suggested answer helped for your issue, do click on "Mark as Answer" and “Vote as Helpful” on the post that helps you, this can be beneficial to other community members.

    Tuesday, February 18, 2020 10:52 AM
  • The Python SDK does provide a way to disable or narrow the logging on storage accounts, an example as bellow: 

    logging.getLogger("azure.storage.common.storageclient").setLevel(logging.WARNING)

    I'd recommend checking an identical post which was posted in Stacknbsp;https://stackoverflow.com/questions/52051501/azure-blob-storage-sdk-switch-off-logging

    Let me know if this helps.

    Thanks,

    Adam

     

    That's maybe a good temporary solution but the logs that are now in INFO need to be in DEBUG!
    They are logs to help debug the system so there's no reason for them to be in INFO.
    Right now I set that to WARNING like you said, but I want to be able to get those debug logs if my entire program is in DEBUG level.
    Now I need to set it manually if I want to get those logs. It's not a solution, it's a workaround.
    I see there's an open issue for it in Github https://github.com/Azure/azure-storage-python/issues/516 but no one replied there for a while and the library itself didn't get any new versions for a while so I hope it's still in development and this issue be fixed.


    Edit: And for me the actual logger I needed to change was actually "azure.core.pipeline.policies.http_logging_policy"


    • Edited by naor2013 Monday, May 11, 2020 12:48 PM
    Monday, May 11, 2020 12:18 PM