Skip to main content
Helicone OSS LLM Observability

Custom Logs with the Logger SDK

Log any custom operations using Helicone's Logger SDK for complete observability across your application stack.
2 min read

The Logger SDK allows you to log any custom operation to Helicone - database queries, API calls, ML inference, file processing, or any other operation you want to track.

To get started, install the @helicone/helpers package

Set up your Helicone API key in your .env file

Log into Helicone or create an account. Once you have an account, you can generate an API key here.

Create a new HeliconeManualLogger instance

Log your request

The logRequest method takes three parameters:

  1. Request data: What you're logging (query, operation name, etc.)
  2. Operation function: The actual work being done
  3. Headers: Optional custom properties or session tracking

Verify your requests in Helicone

With the above setup, any calls to any data operation will automatically be logged and monitored by Helicone. Review them in your Helicone dashboard.

Understanding the Structure#

All custom logs follow the same pattern with two parts:

Request Data#

What you're about to do. Must include:

  • _type: "data" - Identifies this as a custom data log
  • name - A descriptive name for your operation
  • Any custom fields you want to track (query, endpoint, model, etc.)

Response Data#

What happened. Should include:

  • _type: "data" - Identifies this as a custom data response
  • name - Same name as the request
  • status - Success or error state
  • Any result data you want to track

More Examples#

API Call#

ML Model Inference#

For more examples, check out our GitHub examples.

To learn more about the HeliconeManualLogger API, see the API Reference here.