Skip to main content

Coralogix Python SDK

Project description

Coralogix - Logs in Action

Coralogix is a software analytics SaaS platform that drastically improves the delivery & maintenance process for software providers. Using proprietary machine learning algorithms, Coralogix helps over 100 businesses reduce their issue resolution time, increase system uptime, improve customer satisfaction and decrease maintenance costs.

Learn more at http://www.coralogix.com.

Contents

This package includes all Coralogix Python SDK files and settings required for sending logs to Coralogix Cloud.

tl;dr:

$ pip install coralogix

>>> from coralogix import CoralogixHTTPSHandler
>>> handler = CoralogixHTTPSHandler(company_id, private_key, application, subsystem, computer_name)
>>> logger.addHandler(handler)
>>> logger.setLevel(logging.DEBUG)

Installation

Coralogix SDK can be directly installed using pip package manager:

$ pip install coralogix

Please confirm that you have the latest pip package manager beforehand:

$ pip install pip –upgrade

If you are upgrading coralogix from an older version, you may need to add the upgrade flag:

$ pip install coralogix –upgrade

Alternatively, Coralogix SDK can be installed from source by extracting the files and executing:

$ python setup.py install

Usage

After installing the coralogix module, import CoralogixHTTPSHandler and add it to the logging.Logger object you are currently using. If you’re new to Python logging, a detailed explanation can be found for:

Python 2 - https://docs.python.org/2/library/logging.html

Python 3 - https://docs.python.org/3/library/logging.html

Instructions

Using Coralogix SDK requires four mandatory parameters and one optional parameter:

company_id (Integer): A unique ID which represents your company. This ID will be sent to your mail once you register to Coralogix.

private_key (String): The private key is the password for your company, used to validate your authenticity. This key will be sent to your mail once you register to Coralogix.

application (String): The name of your main application. For example, a company named Startup which develops app_1 and app_2 can use “Startup app_1” and “Startup app_2” for this parameter; or if they want to debug their test environment they might insert the “Startup app_1 - Test” or “Startup app_1 - Staging”.

subsystem (String): The name of your sub-system. Your application probably has multiple sub-systems, e.g. “Backend servers”, “Middleware”, “Frontend servers”, “Database servers” etc. In order to help you examine only the data you need, inserting the subsystem parameter is vital.

computer_name (String): Optional. When several servers run the same application/sub-system, you will enjoy the full power of Coralogix if you use a different computer_name per server.

  1. Prepare your company_id and private_key (provided to you in advance). They can also be found under “Send Your Logs” in the “Settings & Info” tab. e.g.
    >>> company_id = 173 ; private_key = "2b03ed7f-210c-492a-b035-549c0020e91f"
    
  2. Import CoralogixHTTPSHandler. e.g.
    >>> from coralogix import CoralogixHTTPSHandler
    
  3. Instantiate a CoralogixHTTPSHandler object with company_id, private_key, app_name, sub_system_name and computer_name. CoralogixHTTPSHandler will immediately try to connect to Coralogix with the data provided. e.g.
    >>> handler = CoralogixHTTPSHandler(173, "2b03ed7f-210c-492a-b035-549c0020e91f", application, subsystem, computer_name)
    

    You may instantiate several CoralogixHTTPSHandlers for different applications and sub-systems in the same process. To avoid data duplication, please ensure that loggers of the same logging tree don’t propagate across many CoralogixHTTPSHandlers (logger.propagate=False)

  4. Add the handler to your existing logging.Logger object. e.g.
    >>> logger.addHandler(handler)
    
  5. You’re up and ready. Any log record accepted by your logging.Logger object will now also be sent to Coralogix Cloud.

  6. It is recommended to set your logging.Logger level to logging.DEBUG to get the maximum value from your data. e.g.
    >>> logger.setLevel(logging.DEBUG)
    

License

Copyright 2015 Coralogix Ltd.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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

coralogix-0.2.6.6.tar.gz (24.0 kB view details)

Uploaded Source

Built Distributions

coralogix-0.2.6.6.win-amd64.exe (255.9 kB view details)

Uploaded Source

coralogix-0.2.6.6-py3.4.egg (61.4 kB view details)

Uploaded Source

File details

Details for the file coralogix-0.2.6.6.tar.gz.

File metadata

  • Download URL: coralogix-0.2.6.6.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for coralogix-0.2.6.6.tar.gz
Algorithm Hash digest
SHA256 dc739543823bdeb8973c38d4c82d89915440bd7aaeb946b2ee89aa90a3ea9fec
MD5 a06b30d32b3ae0bb8c328a56f95e5f1a
BLAKE2b-256 083c570a2dc00cfd165a9a44b7679db9ae0329bd6eb76d7b8b6b6669d61a3b24

See more details on using hashes here.

File details

Details for the file coralogix-0.2.6.6.win-amd64.exe.

File metadata

File hashes

Hashes for coralogix-0.2.6.6.win-amd64.exe
Algorithm Hash digest
SHA256 fdb2d3278a7c7a2d40831fb64038243be3f3e8da04aa2ed5787d92a38b52080b
MD5 b1fc965bc8316edff46759b9c259d371
BLAKE2b-256 e731c161424fdf9644a6d3466c92a6efc10727b135363f6e1c7a54e7838b2877

See more details on using hashes here.

File details

Details for the file coralogix-0.2.6.6-py3.4.egg.

File metadata

File hashes

Hashes for coralogix-0.2.6.6-py3.4.egg
Algorithm Hash digest
SHA256 ed37b776c456e69b2d93b881b2571fbdfdeb2304461ea88794c42e47baa180b7
MD5 b450898709b41499c916b236acfb24d1
BLAKE2b-256 f8a39b0e72db4b7f94811869f6ac24f9049aeb56cdd635b787a5bbaec5efa3c0

See more details on using hashes here.

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