Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

Python Logger for Logging Data on Amazon CloudSearch

Project Description

CloudSearch-Logger

This module helps you in logging data on amazon cloudsearch server using python logger.

Installing

When pip is available, the distribution can be downloaded from PyPI and installed in single step

Pip:

pip install CloudSearch-Logger

or you can use easy_install

Easy Install:

easy_install CloudSearch-Logger

Manual:

python setup.py install

Usage

You can use this cloudsearch logger in python scripting code and in django web application as well.

Example1

import logging
import uuid

from cloudsearch_logger import CloudSearchHandler

test_logger = logging.getLogger('python-cloudsearch-logger')
test_logger.setLevel(logging.INFO)
test_logger.addHandler(CloudSearchHandler(
    domain='domain-name',
    region='us-east-1',
    aws_access_key_id='aws-access-key-id',
    aws_secret_access_key='aws-access-secret-key'))

data = dict(_document_id=str(uuid.uuid4()), ...)

test_logger.info(data)

Using with Django

Modify your settings.py file to integrate cloudsearch-logger with Django’s logging:

LOGGING = {
  ...
  'handlers': {
      'cloudsearch': {
          'level': 'INFO',
          'class': 'cloudsearch_logger.CloudSearchHandler',
          'domain': 'domain-name',
          'region': 'us-east-1',  # Default value: us-east-1
          'aws_secret_access_key': 'aws-access-secret-key',
          'aws_access_key_id': 'aws-access-key-id'
      },
  },
  'loggers': {
      'django.request': {
          'handlers': ['cloudsearch'],
          'level': 'INFO',
          'propagate': True,
      },
  },
  ...
}

You can find more examples in the example1.py and example2.py files.

Release History

Release History

This version
History Node

0.2

History Node

0.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
CloudSearch-Logger-0.2.tar.gz (5.0 kB) Copy SHA256 Checksum SHA256 Source Oct 24, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting