Logging handler for Application Insights by BogdanBe · Pull Request #2 · microsoft/ApplicationInsights-Python · GitHub
Skip to content

Logging handler for Application Insights#2

Merged
southwood merged 3 commits into
developfrom
features/logging
Jan 3, 2015
Merged

Logging handler for Application Insights#2
southwood merged 3 commits into
developfrom
features/logging

Conversation

@BogdanBe

@BogdanBe BogdanBe commented Jan 3, 2015

Copy link
Copy Markdown

This adds a new sub-module: applicationinsights.logging for the purpose of logging integration. Usage:

import logging
from applicationinsights.logging import ApplicationInsightsHandler

# set up logging
handler = ApplicationInsightsHandler('<YOUR INSTRUMENTATION KEY GOES HERE>')
logging.basicConfig(handlers=[ handler ], format='%(levelname)s: %(message)s', level=logging.DEBUG)

# log something (this will be sent to the Application Insights service as a trace)
logging.debug('This is a message')

southwood added a commit that referenced this pull request Jan 3, 2015
Logging handler for Application Insights
@southwood southwood merged commit 5b7b01b into develop Jan 3, 2015
@BogdanBe BogdanBe deleted the features/logging branch January 3, 2015 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants