This is an automated email from the ASF dual-hosted git repository.

alexstocks pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/develop by this push:
     new 1a7b1690a feat: implement service registration logging (#3043)
1a7b1690a is described below

commit 1a7b1690ae5177e7a549adabef414c4cb3e7ebc2
Author: CAICAII <[email protected]>
AuthorDate: Wed Oct 1 10:56:36 2025 +0800

    feat: implement service registration logging (#3043)
    
    * feat: implement service registration logging
    
    * style: fix code formatting
    
    * Improve comments in service configuration logic
    
    Refactor comments for clarity in service configuration retrieval.
---
 server/server.go | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/server/server.go b/server/server.go
index 29f23044e..1d531f1da 100644
--- a/server/server.go
+++ b/server/server.go
@@ -97,6 +97,10 @@ func (s *Server) genSvcOpts(handler any, opts 
...ServiceOption) (*ServiceOptions
        prosCfg := s.cfg.Protocols
        regsCfg := s.cfg.Registries
        // todo(DMwangnima): record the registered service
+       // Record the registered service for debugging and monitoring
+       interfaceName := common.GetReference(handler)
+       logger.Infof("Registering service: %s", interfaceName)
+
        newSvcOpts := defaultServiceOptions()
        if appCfg != nil {
                svcOpts = append(svcOpts,
@@ -121,7 +125,6 @@ func (s *Server) genSvcOpts(handler any, opts 
...ServiceOption) (*ServiceOptions
        // Get service-level configuration items from provider.services 
configuration
        if proCfg != nil && proCfg.Services != nil {
                // Get the unique identifier of the handler (the default is the 
structure name or the alias set during registration)
-               interfaceName := common.GetReference(handler)
                // Give priority to accurately finding the service 
configuration from the configuration based on the reference name (i.e. the 
handler registration name)
                svcCfg, ok := proCfg.Services[interfaceName]
                if !ok {

Reply via email to