Documentation ¶
Overview ¶
Package logpolicy manages the creation or reuse of logtail loggers, caching collection instance state on disk for use on future runs of programs on the same machine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogURL ¶
func LogURL() string
LogURL is the base URL for the configured logtail server, or the default. It is guaranteed to not terminate with any forward slashes.
func NewLogtailTransport ¶
NewLogtailTransport returns an HTTP Transport particularly suited to uploading logs to the given host name. This includes:
- If DNS lookup fails, consult the bootstrap DNS list of Tailscale hostnames.
- If TLS connection fails, try again using LetsEncrypt's built-in root certificate, for the benefit of older OS platforms which might not include it.
Types ¶
type Config ¶
Config represents an instance of logs in a collection.
func ConfigFromBytes ¶
ConfigFromBytes parses a Config from its JSON encoding.
func ConfigFromFile ¶
ConfigFromFile reads a Config from a JSON file.
type Policy ¶
type Policy struct { // Logtail is the logger. Logtail *logtail.Logger // PublicID is the logger's instance identifier. PublicID logtail.PublicID }
Policy is a logger and its public ID.
func NewWithConfigPath ¶
NewWithConfigPath is identical to New, but uses the specified directory and command name. If either is empty, it derives them automatically.
func (*Policy) SetVerbosityLevel ¶
SetVerbosityLevel controls the verbosity level that should be written to stderr. 0 is the default (not verbose). Levels 1 or higher are increasingly verbose.
It should not be changed concurrently with log writes.