Browse Source

chore: change port to 6060 by default in devserver (#3191)

Kevin Wan 2 năm trước cách đây
mục cha
commit
b028ed058d
2 tập tin đã thay đổi với 7 bổ sung5 xóa
  1. 6 4
      core/logx/logs.go
  2. 1 1
      internal/devserver/config.go

+ 6 - 4
core/logx/logs.go

@@ -358,14 +358,16 @@ func createOutput(path string) (io.WriteCloser, error) {
 		return nil, ErrLogPathNotSet
 	}
 
+	var rule RotateRule
 	switch options.rotationRule {
 	case sizeRotationRule:
-		return NewLogger(path, NewSizeLimitRotateRule(path, backupFileDelimiter, options.keepDays,
-			options.maxSize, options.maxBackups, options.gzipEnabled), options.gzipEnabled)
+		rule = NewSizeLimitRotateRule(path, backupFileDelimiter, options.keepDays, options.maxSize,
+			options.maxBackups, options.gzipEnabled)
 	default:
-		return NewLogger(path, DefaultRotateRule(path, backupFileDelimiter, options.keepDays,
-			options.gzipEnabled), options.gzipEnabled)
+		rule = DefaultRotateRule(path, backupFileDelimiter, options.keepDays, options.gzipEnabled)
 	}
+
+	return NewLogger(path, rule, options.gzipEnabled)
 }
 
 func getWriter() Writer {

+ 1 - 1
internal/devserver/config.go

@@ -4,7 +4,7 @@ package devserver
 type Config struct {
 	Enabled       bool   `json:",default=true"`
 	Host          string `json:",optional"`
-	Port          int    `json:",default=6470"`
+	Port          int    `json:",default=6060"`
 	MetricsPath   string `json:",default=/metrics"`
 	HealthPath    string `json:",default=/healthz"`
 	EnableMetrics bool   `json:",default=true"`