Python Logging Configuration Example

Ship logs from Python to Logit.io

This guide has been setup and tested using Python 3.12 (64-bit) environments. Code samples included can be used inside a basic Python script, or web framework such as Django or Flask. To send logs to Logit.io in a Python script you will need the python-logstash-async (version 2.5.0) Python plugin.

Install Integration

Please click on the Install Integration button to configure your stack for this source.

Installing the Python logging handler

Execute the following command using pip (the official Python package installer) to install the logging handler. This sends Python logging events to Logstash, which is part of your Logit.io log management stack:

pip install python-logstash-async

PIP is available by default on v3.4 or later of Python. If you are using an earlier version of Python consider updating to a more recent version. Older versions are available here (opens in a new tab) but are no longer supported by the PIP development team.

Sending Logs

⚠️

No Beats/Beats-SSL input available! Your stack is missing the required input for this data source.

Talk to support to add the input

Launch Logs to View Data

Launch Logs

More Help

If you need any further assistance with migrating your Python application logs (opens in a new tab) to Logit.io we're here to help you get started. Just get in contact with our support team via live chat and we'll be happy to assist.