Skip to content

os/glog: Does GoFrame support for logging fields? #3869

Open
@RyoJerryYu

Description

@RyoJerryYu

What do you want to ask?

We are using logrus and logging like this:

log.Info("A simple log")
log.WithFields(log.Fields{
  "event": event,
  "user_id": userId,
}).Info("A log with fields")

And it produce json logs like below:

{
  "log": "A simple log"
}
{
  "event": "event",
  "user_id": "user_id",
  "log": "A log with fields"
}

So we can use the fields to filter our logs such as:

select log
where  user_id = 1 and event = "event"

Do GoFrame support this? Or how can I implement something like this in GoFrame?

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurehelp wantedplannedThis issue/proposal is planned into our next steps.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions