Skip to content

Commit

Permalink
Context Driven Handler Example Slog
Browse files Browse the repository at this point in the history
Support for context driven handler behavior in slog
  • Loading branch information
iamemilio committed Apr 19, 2024
1 parent 0f93238 commit cbba1dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions v3/integrations/logcontext-v2/nrslog/example/main.go
Expand Up @@ -24,8 +24,8 @@ func main() {
log.Info("I am a log message")

txn := app.StartTransaction("example transaction")
txnLogger := nrslog.WithTransaction(txn, log)
txnLogger.Info("I am a log inside a transaction")
txnCtx := newrelic.NewContext(context.Background(), txn)
txnLogger.InfoContext(txnCtx, "I am a log inside a transaction")

// pretend to do some work
time.Sleep(500 * time.Millisecond)
Expand Down

0 comments on commit cbba1dc

Please sign in to comment.