Star us on GitHub
Star
Menu

Using highlight.io without a framework in Elixir

Learn how to set up highlight.io without a framework.

1

Install the Highlight Elixir SDK.

Add Highlight to your mix.exs file.

defp deps do [ ... {:highlight, "~> 0.1"} ] end
Copy
2

Initialize the Highlight Elixir SDK.

Highlight.init/0 initializes the SDK.

Highlight.init()
Copy
3

Record exceptions.

Highlight.record_exception/4 can be used to explicitly record any exception.

try do # some code that may raise an error rescue exception -> Highlight.record_exception(exception, %Highlight.Config{ project_id: "your_project_id", service_name: "your_service_name", service_version: "1.0.0" }, "session_12345", "request_67890") end
Copy
4

Verify your errors are being recorded.

Now that you've set up the SDK, you can verify that the backend error handling works by sending an error in. Visit the highlight errors page and check that backend errors are coming in.

5

Set up logging.

Start sending logs to Highlight! Follow the logging setup guide to get started.