Skip to content

Commit

Permalink
Added exec logs to Teresa server (#615)
Browse files Browse the repository at this point in the history
* Added exec log with user email and command

* added delimiter to cmd log
  • Loading branch information
retpolanne authored Oct 21, 2019
1 parent fb909f3 commit 10694c2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/server/exec/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package exec
import (
"time"

log "github.com/Sirupsen/logrus"
"github.com/luizalabs/teresa/pkg/goutil"
execpb "github.com/luizalabs/teresa/pkg/protobuf/exec"
"github.com/luizalabs/teresa/pkg/server/database"
Expand All @@ -19,6 +20,7 @@ type Service struct {
func (s *Service) Command(req *execpb.CommandRequest, stream execpb.Exec_CommandServer) error {
ctx := stream.Context()
u := ctx.Value("user").(*database.User)
log.Infof("Received exec: cmd <%v>, user %v:", req.Command, u)

rc, errChan := s.ops.RunCommand(ctx, u, req.AppName, req.Command...)
if rc == nil {
Expand Down

0 comments on commit 10694c2

Please sign in to comment.