Our next-gen architecture is built to help you make sense of your ever-growing data. Watch a 4-min demo video!

Back to All Integrations

Go Go

Last Updated: Aug. 02, 2023

Coralogix provides Go SDK for your Go applications.

Installation

You need to install go-coralogix-sdk package as any other external package:

go install github.com/coralogix/go-coralogix-sdk

After the installation you can import the package:

import (
    coralogix "github.com/coralogix/go-coralogix-sdk"
)

Input the team hostname associated with your Coralogix domain in the following URLs:

CORALOGIX_LOG_URL=https://api.CORALOGIX_TEAM_HOSTNAME:443/api/v1/logs
CORALOGIX_TIME_DELTA_URL=https://api.CORALOGIX_TEAM_HOSTNAME:443/sdk/v1/time

Example for India (IN) cluster:
CORALOGIX_LOG_URL=https://api.app.coralogix.in:443/api/v1/logs
CORALOGIX_TIME_DELTA_URL=https://api.app.coralogix.in:443/sdk/v1/time

Code Example

package main

import (
    coralogix "github.com/coralogix/go-coralogix-sdk"
)

func main() {
    coralogix.SetDebug(true)

    logger := coralogix.NewCoralogixLogger(
        "YOUR_PRIVATE_KEY_HERE",
        "YOUR_APPLICATION_NAME",
        "YOUR_SUBSYSTEM_NAME",
    )
    defer logger.Destroy()

    logger.Debug("Test message 1")
    logger.Info(map[string]string{
        "text":  "Test message 2",
        "extra": "additional",
    })
    logger.Warning("Test message 4")
}

Additional Resources

You can find more information about the go-coralogix-sdk package:

Support

Need help?

Our world-class customer success team is available 24/7 to walk you through your setup and answer any questions that may come up.

Feel free to reach out to us via our in-app chat or by sending us an email at [email protected].

On this page