mirror of
https://github.com/alibaba/higress.git
synced 2026-05-11 06:17:26 +08:00
fix: fix non-json logs with log_as_json enabled (#3779)
Signed-off-by: CH3CHO <ch3cho@qq.com>
This commit is contained in:
@@ -18,7 +18,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"istio.io/pkg/log"
|
||||
"istio.io/istio/pkg/log"
|
||||
|
||||
"github.com/alibaba/higress/v2/pkg/cmd"
|
||||
)
|
||||
|
||||
@@ -17,14 +17,12 @@ package cert
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"reflect"
|
||||
"sync"
|
||||
|
||||
"github.com/caddyserver/certmagic"
|
||||
"github.com/mholt/acmez"
|
||||
"go.uber.org/zap"
|
||||
"go.uber.org/zap/zapcore"
|
||||
istiomodel "istio.io/istio/pilot/pkg/model"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
)
|
||||
@@ -60,11 +58,7 @@ func InitCertMgr(opts *Option, clientSet kubernetes.Interface, config *Config, X
|
||||
var storage certmagic.Storage
|
||||
storage, _ = NewConfigmapStorage(opts.Namespace, clientSet)
|
||||
renewalWindowRatio := float64(config.RenewBeforeDays) / float64(RenewMaxDays)
|
||||
logger := zap.New(zapcore.NewCore(
|
||||
zapcore.NewConsoleEncoder(zap.NewProductionEncoderConfig()),
|
||||
os.Stderr,
|
||||
zap.DebugLevel,
|
||||
))
|
||||
logger := zap.L()
|
||||
magicConfig := certmagic.Config{
|
||||
RenewalWindowRatio: renewalWindowRatio,
|
||||
Storage: storage,
|
||||
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
consulapi "github.com/hashicorp/consul/api"
|
||||
"github.com/hashicorp/consul/api/watch"
|
||||
"istio.io/api/networking/v1alpha3"
|
||||
"istio.io/pkg/log"
|
||||
"istio.io/istio/pkg/log"
|
||||
|
||||
apiv1 "github.com/alibaba/higress/v2/api/networking/v1"
|
||||
"github.com/alibaba/higress/v2/pkg/common"
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"istio.io/api/networking/v1alpha3"
|
||||
"istio.io/pkg/log"
|
||||
"istio.io/istio/pkg/log"
|
||||
|
||||
apiv1 "github.com/alibaba/higress/v2/api/networking/v1"
|
||||
"github.com/alibaba/higress/v2/pkg/common"
|
||||
@@ -268,4 +268,3 @@ func (w *watcher) getSni(se *v1alpha3.ServiceEntry) string {
|
||||
func (w *watcher) GetRegistryType() string {
|
||||
return w.RegistryConfig.Type
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
|
||||
"github.com/avast/retry-go/v4"
|
||||
"github.com/hudl/fargo"
|
||||
"istio.io/pkg/log"
|
||||
"istio.io/istio/pkg/log"
|
||||
)
|
||||
|
||||
var httpClient = http.DefaultClient
|
||||
|
||||
@@ -16,7 +16,7 @@ package client
|
||||
|
||||
import (
|
||||
"github.com/hudl/fargo"
|
||||
"istio.io/pkg/log"
|
||||
"istio.io/istio/pkg/log"
|
||||
)
|
||||
|
||||
type Handler func(application *fargo.Application) error
|
||||
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
|
||||
"github.com/hudl/fargo"
|
||||
"istio.io/api/networking/v1alpha3"
|
||||
"istio.io/pkg/log"
|
||||
"istio.io/istio/pkg/log"
|
||||
|
||||
apiv1 "github.com/alibaba/higress/v2/api/networking/v1"
|
||||
"github.com/alibaba/higress/v2/pkg/common"
|
||||
|
||||
@@ -28,7 +28,7 @@ import (
|
||||
"istio.io/api/networking/v1alpha3"
|
||||
"istio.io/istio/pkg/config"
|
||||
"istio.io/istio/pkg/config/schema/gvk"
|
||||
"istio.io/pkg/log"
|
||||
"istio.io/istio/pkg/log"
|
||||
|
||||
"github.com/alibaba/higress/v2/pkg/common"
|
||||
higressconfig "github.com/alibaba/higress/v2/pkg/config"
|
||||
|
||||
@@ -25,7 +25,7 @@ import (
|
||||
"time"
|
||||
|
||||
"go.uber.org/atomic"
|
||||
"istio.io/pkg/log"
|
||||
"istio.io/istio/pkg/log"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -32,7 +32,7 @@ import (
|
||||
"github.com/nacos-group/nacos-sdk-go/v2/vo"
|
||||
"go.uber.org/atomic"
|
||||
"istio.io/api/networking/v1alpha3"
|
||||
"istio.io/pkg/log"
|
||||
"istio.io/istio/pkg/log"
|
||||
|
||||
apiv1 "github.com/alibaba/higress/v2/api/networking/v1"
|
||||
"github.com/alibaba/higress/v2/pkg/common"
|
||||
|
||||
@@ -27,7 +27,7 @@ import (
|
||||
"github.com/nacos-group/nacos-sdk-go/model"
|
||||
"github.com/nacos-group/nacos-sdk-go/vo"
|
||||
"istio.io/api/networking/v1alpha3"
|
||||
"istio.io/pkg/log"
|
||||
"istio.io/istio/pkg/log"
|
||||
|
||||
apiv1 "github.com/alibaba/higress/v2/api/networking/v1"
|
||||
"github.com/alibaba/higress/v2/pkg/common"
|
||||
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"istio.io/pkg/log"
|
||||
"istio.io/istio/pkg/log"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
apiv1 "github.com/alibaba/higress/v2/api/networking/v1"
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
|
||||
apiv1 "github.com/alibaba/higress/v2/api/networking/v1"
|
||||
"istio.io/api/networking/v1alpha3"
|
||||
"istio.io/pkg/log"
|
||||
"istio.io/istio/pkg/log"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -30,7 +30,7 @@ import (
|
||||
"github.com/hashicorp/go-multierror"
|
||||
"go.uber.org/atomic"
|
||||
"istio.io/api/networking/v1alpha3"
|
||||
"istio.io/pkg/log"
|
||||
"istio.io/istio/pkg/log"
|
||||
|
||||
apiv1 "github.com/alibaba/higress/v2/api/networking/v1"
|
||||
"github.com/alibaba/higress/v2/pkg/common"
|
||||
@@ -665,7 +665,7 @@ func (w *watcher) Run() {
|
||||
defer func() {
|
||||
log.Info("[zookeeper] Run is down")
|
||||
if r := recover(); r != nil {
|
||||
log.Info("Recovered in f", "r is", r)
|
||||
log.Infof("Recovered in Run: %v", r)
|
||||
}
|
||||
}()
|
||||
ticker := time.NewTicker(30 * time.Second)
|
||||
|
||||
Reference in New Issue
Block a user