[
https://issues.apache.org/jira/browse/SCB-776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16561464#comment-16561464
]
ASF GitHub Bot commented on SCB-776:
------------------------------------
tianxiaoliang commented on a change in pull request #401: SCB-776 Log print
more detailed
URL:
https://github.com/apache/incubator-servicecomb-service-center/pull/401#discussion_r206024447
##########
File path: server/service/instance.go
##########
@@ -89,43 +89,47 @@ func (s *InstanceService) Register(ctx context.Context, in
*pb.RegisterInstanceR
remoteIP := util.GetIPFromContext(ctx)
if err := Validate(in); err != nil {
- util.Logger().Errorf(err, "register instance failed, invalid
parameters, operator %s.", remoteIP)
+ util.Logger().Errorf(err, "register instance failed, invalid
parameters, operator %s", remoteIP)
return &pb.RegisterInstanceResponse{
Response: pb.CreateResponse(scerr.ErrInvalidParams,
err.Error()),
}, nil
}
instance := in.GetInstance()
- instanceFlag := util.StringJoin([]string{instance.ServiceId,
instance.HostName}, "/")
//允许自定义id
//如果没填写 并且endpoints沒重復,則产生新的全局instance id
oldInstanceId, checkErr := serviceUtil.InstanceExist(ctx, in.Instance)
if checkErr != nil {
- util.Logger().Errorf(checkErr, "instance existence check
failed, service %s, operator %s.",
- instanceFlag, remoteIP)
+ util.Logger().Errorf(checkErr, "instance existence check
failed, endpoints %v, host '%s', serviceId %s, operator %s",
+ instance.Endpoints, instance.HostName,
instance.ServiceId, remoteIP)
resp := pb.CreateResponseWithSCErr(checkErr)
if checkErr.InternalError() {
return &pb.RegisterInstanceResponse{Response: resp},
checkErr
}
return &pb.RegisterInstanceResponse{Response: resp}, nil
}
if len(oldInstanceId) > 0 {
- util.Logger().Infof("register instance successful, reuse
service %s instance %s, operator %s.",
+ util.Logger().Infof("register instance successful, reuse
service %s instance %s, operator %s",
instance.ServiceId, oldInstanceId, remoteIP)
return &pb.RegisterInstanceResponse{
- Response: pb.CreateResponse(pb.Response_SUCCESS,
"instance more exist."),
+ Response: pb.CreateResponse(pb.Response_SUCCESS,
"instance more exist"),
InstanceId: oldInstanceId,
}, nil
}
if err := s.preProcessRegisterInstance(ctx, instance); err != nil {
- util.Logger().Errorf(err, "register instance failed, service
%s, operator %s.", instanceFlag, remoteIP)
+ util.Logger().Errorf(err, "register instance failed, endpoints
%v, host '%s', serviceId %s, operator %s",
+ instance.Endpoints, instance.HostName,
instance.ServiceId, remoteIP)
return &pb.RegisterInstanceResponse{
Response: pb.CreateResponseWithSCErr(err),
}, nil
}
+ ttl := int64(instance.HealthCheck.Interval *
(instance.HealthCheck.Times + 1))
Review comment:
just for log, it need to consume CPU, is it necessary?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Log print more detailed
> -----------------------
>
> Key: SCB-776
> URL: https://issues.apache.org/jira/browse/SCB-776
> Project: Apache ServiceComb
> Issue Type: Improvement
> Components: Service-Center
> Reporter: little-cui
> Assignee: little-cui
> Priority: Major
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)