Azure-docs: Logging with Custom Dimensions doesn't work as expected

Created on 26 Nov 2020  Â·  4Comments  Â·  Source: MicrosoftDocs/azure-docs

I follow "Logging with Custom Dimensions" section to log information to Application Insights. However, the custom_dimensions fields contains out-of-box data, not my custom data. Do you change the way it works? By default, it shows level, lineNumber, fileName, module and process. So some module add this information which replace/override my custom dimensions data?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

corsubsvc cxp machine-learninsvc product-question triaged

All 4 comments

my colleague helped me to find an answer. I needed to change code.

from

logger.info("I will be sent to Application Insights with Custom Dimensions", custom_dimensions)

to

logger.info("I will be sent to Application Insights with Custom Dimensions", extra={'custom_dimensions':custom_dimensions})

@kenakamu Thanks for sharing the answer.
We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.

@ram-msft Could you double check with product team and if this is document bug, please fix :)

Thanks @kenakamu. Will check and update the document.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ManuelMos picture ManuelMos  Â·  46Comments

m-andersen picture m-andersen  Â·  65Comments

renattomachado picture renattomachado  Â·  42Comments

andersgidlund picture andersgidlund  Â·  45Comments

TechTrooper picture TechTrooper  Â·  41Comments