logs

package
v0.0.0-...-68efac8 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2014 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package logs provides a simple API for sending app logs from STDOUT and STDERR through the dropsonde system.

Use

See the documentation for package autowire for details on configuring through environment variables.

Import the package (note that you do not need to additionally import autowire). The package self-initializes; to send logs use

logs.SendAppLog(appId, message, sourceType, sourceInstance)

for sending errors,

logs.SendAppErrorLog(appId, message, sourceType, sourceInstance)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(ls log_sender.LogSender)

Initialize prepares the logs package for use with the automatic Emitter from dropsonde/autowire. This function is called by the package's init method, so should only be explicitly called to reset the default LogSender, e.g. in tests.

func ScanErrorLogStream

func ScanErrorLogStream(appId, sourceType, sourceInstance string, reader io.Reader, stopChan chan struct{})

ScanErrorLogStream sends a log error message with the given meta-data for each line from reader. Restarts on read errors and continues until EOF (or stopChan is closed).

func ScanLogStream

func ScanLogStream(appId, sourceType, sourceInstance string, reader io.Reader, stopChan chan struct{})

ScanLogStream sends a log message with the given meta-data for each line from reader. Restarts on read errors and continues until EOF (or stopChan is closed).

func SendAppErrorLog

func SendAppErrorLog(appId, message, sourceType, sourceInstance string) error

SendAppErrorLog sends a log error message with the given appid, log message, source type and source instance, with a message type of std err. Returns an error if one occurs while sending the event.

func SendAppLog

func SendAppLog(appId, message, sourceType, sourceInstance string) error

SendAppLog sends a log message with the given appid, log message, source type and source instance, with a message type of std out. Returns an error if one occurs while sending the event.

Types

This section is empty.

Jump to

Keyboard shortcuts

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