Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slog with Groups and Attributes #989

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

mirackara
Copy link
Contributor

@mirackara mirackara commented Dec 17, 2024

Builds on-top of #987

  • Support for transactions in context
	txn := app.StartTransaction("test")
	ctx := newrelic.NewContext(context.Background(), txn)
	logger.InfoContext(ctx, "log has tracing on new relic")
	txn.End()
  • Corrected Grouping and Attributes System (Either Method Works)
logger.WithGroup("program_info").With("pid", os.Getpid()).Info("log message with group and attribute")

logger.Info("I am a log group inside a log message",
	slog.Group("logGroup",
		slog.String("key1", "val"),
		slog.Int("key2", 1),
	),
)

@mirackara mirackara marked this pull request as draft December 17, 2024 18:36
@mirackara mirackara marked this pull request as ready for review January 3, 2025 17:56
@mirackara mirackara changed the title (WIP) Slog with Groups and Attributes Slog with Groups and Attributes Jan 3, 2025
@mirackara mirackara marked this pull request as draft January 3, 2025 20:14
@mirackara
Copy link
Contributor Author

Still Working on this - Updated the example main.go to show what is currently supported.

There are some bugs that still need squashing

  • Issue with Attributes in the LogWithGroupAttributes example being Duplicated
  • Issue with Attributes in the logWithLogAttrs example showing up correctly with their groups on nr1, but not in the log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants