added simple log rotator
This commit is contained in:
@@ -35,6 +35,8 @@ type Config struct {
|
||||
LogPath string `json:"logfile" yaml:"logfile"`
|
||||
RunPath string `json:"runfile" yaml:"runfile"`
|
||||
AsDaemon bool `json:"asDaemon" yaml:"asDaemon"`
|
||||
LogLimit int64 `json:"logLimit" yaml:logLimit`
|
||||
|
||||
}
|
||||
|
||||
func NewConfig() (*Config, error) {
|
||||
@@ -43,6 +45,7 @@ func NewConfig() (*Config, error) {
|
||||
Port: client.DefaultServicePort,
|
||||
},
|
||||
AsDaemon: false,
|
||||
LogLimit: 1024 * 1024 * 10, // 10 Mb
|
||||
}
|
||||
hostname, err := os.Hostname()
|
||||
if err != nil {
|
||||
|
||||
10
app/config/variant.go
Normal file
10
app/config/variant.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package config
|
||||
|
||||
const (
|
||||
confdirPath = "/home/ziggi/Projects/sys2agent/etc/minilb"
|
||||
rundirPath = "/home/ziggi/Projects/sys2agent/tmp/run"
|
||||
logdirPath = "/home/ziggi/Projects/sys2agent/tmp/log"
|
||||
datadirPath = "/home/ziggi/Projects/sys2agent/tmp/data"
|
||||
packageVersion = "0.0.1"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user