Add basic logging to file support
This currently logs to a json file with the stream type. This is slow and hard on the cpu and memory so we need to swich this over to something like protobufs for the binary logs but this is just a start. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -214,3 +214,17 @@ func (s *Supervisor) getContainerForPid(pid int) (runtime.Container, error) {
|
||||
func (s *Supervisor) SendEvent(evt *Event) {
|
||||
s.events <- evt
|
||||
}
|
||||
|
||||
func (s *Supervisor) log(path string, i *runtime.IO) error {
|
||||
config := &logConfig{
|
||||
BundlePath: path,
|
||||
Stdin: i.Stdin,
|
||||
Stdout: i.Stdout,
|
||||
Stderr: i.Stderr,
|
||||
}
|
||||
// TODO: save logger to call close after its all done
|
||||
if _, err := newLogger(config); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user