diff --git a/docs/Config.md b/docs/Config.md index b1d0c4d7..879c2787 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -38,7 +38,8 @@ gui: expandFocusedSidePanel: false logs: timestamps: false - since: '60m' + since: '60m' # set to '' to show all logs + tail: '' # set to 200 to show last 200 lines of logs commandTemplates: dockerCompose: docker-compose restartService: '{{ .DockerCompose }} restart {{ .Service.Name }}' diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index c146a099..13815331 100644 --- a/pkg/config/app_config.go +++ b/pkg/config/app_config.go @@ -324,6 +324,7 @@ type CustomCommand struct { type LogsConfig struct { Timestamps bool `yaml:"timestamps,omitempty"` Since string `yaml:"since,omitempty"` + Tail string `yaml:"tail,omitempty"` } // GetDefaultConfig returns the application default configuration NOTE (to @@ -359,6 +360,7 @@ func GetDefaultConfig() UserConfig { Logs: LogsConfig{ Timestamps: false, Since: "60m", + Tail: "", }, CommandTemplates: CommandTemplatesConfig{ DockerCompose: "docker-compose", diff --git a/pkg/gui/container_logs.go b/pkg/gui/container_logs.go index d3362c90..bb2feb85 100644 --- a/pkg/gui/container_logs.go +++ b/pkg/gui/container_logs.go @@ -110,6 +110,7 @@ func (gui *Gui) writeContainerLogs(container *commands.Container, ctx context.Co ShowStderr: true, Timestamps: gui.Config.UserConfig.Logs.Timestamps, Since: gui.Config.UserConfig.Logs.Since, + Tail: gui.Config.UserConfig.Logs.Tail, Follow: true, }) if err != nil {