Skip to content

Commit 9a69f22

Browse files
Merge pull request #33 from lizihuai/master
use opening logging
2 parents f88e830 + 842a3b4 commit 9a69f22

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

csemonitor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (reporter *Reporter) Run() {
5555
ticker := time.Tick(reporter.Interval)
5656
metricsAPI, err := NewCseMonitorClient(reporter.Header, reporter.CseMonitorAddr, reporter.TLSConfig, "v2")
5757
if err != nil {
58-
lager.Logger.Errorf(err, "Get cse monitor client failed")
58+
lager.Logger.Errorf("Get cse monitor client failed:%s", err)
5959
}
6060
IsMonitoringConnected = true
6161
isConnctedForFirstTime := false

register.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package metricsink
22

33
import (
4+
"time"
5+
46
"github.com/go-chassis/go-chassis/core/common"
57
"github.com/go-chassis/go-chassis/core/config"
68
"github.com/go-chassis/go-chassis/core/lager"
79
chassisMetrics "github.com/go-chassis/go-chassis/metrics"
810
"github.com/go-chassis/go-chassis/third_party/forked/afex/hystrix-go/hystrix/metric_collector"
911
"github.com/rcrowley/go-metrics"
10-
"time"
1112
)
1213

1314
func init() {
@@ -26,7 +27,7 @@ func reportMetricsToCSEDashboard(r metrics.Registry) error {
2627

2728
tlsConfig, tlsError := getTLSForClient(monitorServerURL)
2829
if tlsError != nil {
29-
lager.Logger.Errorf(tlsError, "Get %s.%s TLS config failed.", monitorServerURL, common.Consumer)
30+
lager.Logger.Errorf("Get %s.%s TLS config failed,error : %s", monitorServerURL, common.Consumer, tlsError)
3031
return tlsError
3132
}
3233

utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const (
2525
func getTLSForClient(monitorURL string) (*tls.Config, error) {
2626
monitorServerURL, err := url.Parse(monitorURL)
2727
if err != nil {
28-
lager.Logger.Error("Error occurred while parsing Monitor Server Uri", err)
28+
lager.Logger.Error("Error occurred while parsing Monitor Server Uri" + err.Error())
2929
return nil, err
3030
}
3131
scheme := monitorServerURL.Scheme

0 commit comments

Comments
 (0)