Skip to content

Commit

Permalink
Merge pull request #78 from dhruv0000/enhance/log-streaming
Browse files Browse the repository at this point in the history
Added primary and secondary refs for logs
  • Loading branch information
leecalcote authored Jul 9, 2021
2 parents bd05fc2 + 48ca0c0 commit e668138
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions meshsync/logstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ func (h *Handler) streamLogs(id string, req model.LogRequest, cfg config.Listene
ObjectType: broker.LogStreamObject,
EventType: broker.Add,
Object: &model.LogObject{
ID: req.ID,
Data: message,
ID: req.ID,
Data: message,
Primary: req.Name,
Secondary: req.Container,
},
})
if err != nil {
Expand Down
6 changes: 6 additions & 0 deletions pkg/model/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ package model
type LogObject struct {
ID string `json:"id,omitempty"`
Data string `json:"data,omitempty"`

// Name of Pod, Svc, Deply getting logs for
Primary string `json:"primary,omitempty"`

// Specific detail about the log like Container or Pod Name
Secondary string `json:"secondary,omitempty"`
}

type LogRequest struct {
Expand Down

0 comments on commit e668138

Please sign in to comment.