Coralogix rest API

Coralogix exposes an API that allows you to sent your logs from basically anywhere, here is how:

Schema

Endpoint Details

URL https://api.coralogix.com/api/v1/logs
HTTP Method POST
Content-Type application/json

 

*We recommend sending logs in “bulks” or “batches” to minimize network calls.

**If you are using Ajax (or similar technology) you might need to send the data with JSON.stringify())

You can group logs from the same application, subsystem and computer under a single API call using the “logEntries” property.
Note that the API is limited to a message size of 2MB which is approximately 3000 medium sized logs.

POST Body

RequiredProperty NameProperty TypeNote
YesprivateKeyUUID
YesapplicationNamestringusually used to separate environments
YessubsystemNamestringusually used to separate components
computerNamestring
YeslogEntriesarray of logs

Log

RequiredProperty NameProperty TypeNotes
YestimestampnumberUTC milliseconds since 1970 (supports sub millisecond via a floating point)
Yesseveritynumber1 – Debug, 2 – Verbose, 3 – Info, 4 – Warn, 5 – Error, 6 – Critical
Yestextstring
categorystring
classNamestring
methodNamestring
threadIdstring

Coralogix rest API implementation Example:

        {
           "privateKey": "",
           "applicationName": "*insert desired application name*",
           "subsystemName": "*insert desired subsystem name*",
           "computerName": "*insert computer name*",
           "logEntries": [
             {
               "timestamp": 1457827957703.342, 
               "severity": 4,
               "text": "Encountered an error while registering the user john123",
               "category": "DAL",
               "className": "UserManager",
               "methodName": "RegisterUser",
               "threadId": "a-352"
             }
           ]
        }

*Make sure you use UTC time in milliseconds

Need help? We love to assist our customers, simply book your implementation session, and we will walk you through, step by step.

Signup to Coralogix
WordPress Lightbox