GoFr - An opinionated Go Framework (original) (raw)

Advanced Guide

Remote Log Level Change

GoFr makes it easy to adjust the details captured in the application's logs, even while it's running!

This feature allows users to effortlessly fine-tune logging levels without the need for redeployment, enhancing the monitoring and debugging experience. It is facilitated through simple configuration settings.

How it helps?

Configuration

To enable remote log level update, users need to specify the following configuration parameter:

REMOTE_LOG_URL=<URL to user's remote log level endpoint> (e.g., https://log-service.com/log-levels)
REMOTE_LOG_FETCH_INTERVAL=<Interval in seconds> (default: 15)

[!NOTE] If not provided the default interval between the request to fetch log level is 15 seconds.

Remote Log Level Endpoint

The remote log level endpoint should return a JSON response in the following format:

{
  "data": {
    "serviceName": "test-service",
    "logLevel": "DEBUG"
  }
}

GoFr parses this response and adjusts log levels based on the provided configurations.

Previous

Overriding Default

Next

Publishing Custom Metrics