Skip to main content

A logging handler that sends you log entries on Facebook Messenger

Project description

Facebook Logger

A logging handler that sends you log entries on Facebook Messenger

import logging
from facebooklogger import FacebookLogger
logger = logging.getLogger("Home Server")
fb = FacebookLogger(level=logging.INFO)
logger.addHandler(fb)"Server Started")
logger.warning("Something might be wrong")
logger.error("EVERYTHING IS ON FIRE")

Screenshot 1

Getting Started

Install facebooklogger with

pip install facebooklogger

To use the Facebook logger, you will need to create a Facebook page and get two pieces of information. A Page Access Token to authenticate as the page, and the User ID you want logs sent to.


The logger requires two configuration options set:


They can be provided as environment variables, or by creating a file called .env in the working directory that looks like:


Replacing the token and user ID with your own obtained below

Page Access Token

Note that to use this logger you DO NOT need to have your app verified by Facebook, you can just stay in development mode.

Follow the getting started section of

User ID

Facebook Page IDs are unique to the page, and as such if you change page you will need to re-acquire the user id.
Note: You will have to already have the page access token

To get user id, run the following

PAGE_ACCESS_TOKEN=YOURTOKEN python3 -m facebooklogger

and follow the prompts

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for facebooklogger, version 0.2.4
Filename, size File type Python version Upload date Hashes
Filename, size facebooklogger-0.2.4-py3-none-any.whl (5.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size facebooklogger-0.2.4.tar.gz (4.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page