From 632404176de7bbb64553110f76c88d4c6f191c51 Mon Sep 17 00:00:00 2001 From: berlin2123 <68841407+berlin2123@users.noreply.github.com> Date: Sun, 12 Jun 2022 16:29:58 +0800 Subject: [PATCH] Log duration of each connection --- pkg/config/server.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/config/server.go b/pkg/config/server.go index cf298f2e..57876cce 100644 --- a/pkg/config/server.go +++ b/pkg/config/server.go @@ -101,6 +101,11 @@ type ServerCommonConf struct { // before deletion. This is only used if LogWay == "file". By default, this // value is 0. LogMaxDays int64 `ini:"log_max_days" json:"log_max_days"` + // LogDurationTypes specifies the type of connection name, which will log + // the duration of those connections. if it is setting as 'ssh,rdp', it + // will log the duration of the name as 'ssh', 'ssh_1', 'sshname', 'rdp', + // 'rdp_test1' or 'web_my_rdp' . By default, this value is "ssh,rdp". + LogDurationTypes string `json:"log_duration_types"` // DisableLogColor disables log colors when LogWay == "console" when set to // true. By default, this value is false. DisableLogColor bool `ini:"disable_log_color" json:"disable_log_color"` @@ -199,6 +204,7 @@ func GetDefaultServerConf() ServerCommonConf { LogWay: "console", LogLevel: "info", LogMaxDays: 3, + LogDurationTypes: "ssh,rdp", DisableLogColor: false, DetailedErrorsToClient: true, SubDomainHost: "",