loglevel

package
v0.0.0-...-a6d58bf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package loglevel exposes a HTTP handler to dynamically update log levels on a timer.

Calling GET on this handler will return a html form which can be used to input params. The handler accepts URL or Form params which are documented when calling GET on this endpoint.

The following verbositys can be set:

  • glog: set "github.com/aristanetworks/glog" verbosity.
  • glog-vmodule: set "github.com/aristanetworks/glog" verbosity on a per function basis.

The following options control log resetting:

  • timeout: A duration (e.g. "1m") for which the log should remain set at the verbosity passed in. it's safe to send multiple: if you send another request with a timeout, the ongoing timeout will be cancelled but the value will be reset to the original value detected by this endpoint.

This timeout logic is nuanced to handle cases where multiple updates are performed on the log at once. We allow timeout to change, but the original verbosity is preserved. See the following description:

  • User wants to increase verbosity to find bug. Lets assume it starts at 0.
  • They call /debug/loglevel?glog=1&timeout=10m
  • User decides this glog verbosity is not enough, so decides to increase to 10.
  • They call /debug/loglevel?glog=10&timeout=5m
  • We update the verbosity to 10, but instead of reseting to 1 we keep the original reset value from the first log level.
  • After 5 mins, we reset to 0.

Note that if you frequently change verbosity externally to loglevel, or run multiple loglevel handlers, you can introduce race conditions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler() http.Handler

Handler returns a http handler for the loglevel request. See package docs.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL