Skip to main content

A Python logging library for sending logs to Diaspora Streams (Kafka)

Project description

Diaspora Logger

Diaspora Logger is a library for logging and processing events to Diaspora Stream using Globus Auth for authentication. Follow the steps below to set up and run the example producer and consumer scripts.

Setup

  1. Generate Globus Auth Refresh Token: Run credentials.py to generate a Globus Auth refresh token.

    from diaspora_logger import request_token_workflow
    
    request_token_workflow()
    

    Here's an example run:

    Please visit the following URL to authorize the application: <Globus Auth /authorize endpoint>
    Paste the authorization code here: <authorization-code>
    ***
    For Python clients (e.g., example_producer.py and example_consumer.py):
    export DIASPORA_REFRESH=<Globus-Auth-refresh-token>
    ***
    Credential subject claim: <subject-claim>
    Credential subject username: <subject-username>
    credential access token: <access-token> (expires in two days)
    credential refresh token: <refresh-token> (expires in six months of inactivity)
    

    If it's your first time producing to a topic, use our ACL endppoint to claim one or more topics.

  2. Export Credential: Export the generated refresh token to your environment.

    export DIASPORA_REFRESH=<Globus-Auth-refresh-token>
    
  3. Running Producer: Set the topic variable to your producer topic, then call run_producer_example() to start the producer.

    topic = "<producer-topic>"
    run_producer_example(topic)
    
  4. Running Consumer: Set the topic and group_id variables to your consumer topic and group ID respectively, then call run_consumer_example(topic, group_id) to start the consumer.

    topic = '<consumer-topic>'
    group_id = '<consumer-group-id>'
    run_consumer_example(topic, group_id)
    

Public ACL endpoint

TODO

Communication Flows

A

Project details


Download files

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

Source Distribution

diaspora_logger-0.0.6.tar.gz (9.1 kB view hashes)

Uploaded Source

Built Distribution

diaspora_logger-0.0.6-py3-none-any.whl (11.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page