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?
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
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.