allow configuring number of logs to tail

This commit is contained in:
Jesse Duffield 2022-11-23 20:57:29 +11:00
parent b8969fd55f
commit 821cd81b72
3 changed files with 5 additions and 1 deletions

View file

@ -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 }}'

View file

@ -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",

View file

@ -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 {