Documentation
¶
Index ¶
- type LogWriter
- func (b *LogWriter) DebugLogging(enabled bool)
- func (b *LogWriter) EnrichLog(data newrelic.LogData, p []byte) []byte
- func (b *LogWriter) WithContext(ctx context.Context) LogWriter
- func (b *LogWriter) WithTransaction(txn *newrelic.Transaction) LogWriter
- func (b LogWriter) Write(p []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogWriter ¶
type LogWriter struct {
// contains filtered or unexported fields
}
LogWriter is an io.Writer that captures log data for use with New Relic Logs in Context
func New ¶
func New(output io.Writer, app *newrelic.Application) LogWriter
New creates a new NewRelicWriter Object output is the io.Writer destination that you want your log to be written to app must be a vaild, non nil new relic Application
func (*LogWriter) DebugLogging ¶
DebugLogging enables or disables debug error messages being written in the IO output. By default, the nrwriter debug logging is set to false and will fail silently
func (*LogWriter) EnrichLog ¶
EnrichLog attempts to enrich a log with New Relic linking metadata. If it fails, it will return the original log line unless debug=true, otherwise it will print an error on a following line.
func (*LogWriter) WithContext ¶
WithTransaction duplicates the current NewRelicWriter and sets the transaction to the transaction parsed from ctx
func (*LogWriter) WithTransaction ¶
func (b *LogWriter) WithTransaction(txn *newrelic.Transaction) LogWriter
WithTransaction duplicates the current NewRelicWriter and sets the transaction to txn