Code Monkey home page Code Monkey logo

Comments (3)

mytang0 avatar mytang0 commented on August 25, 2024

Is the connection status of the client ESTABLISHED?

from nacos.

xuechaos avatar xuechaos commented on August 25, 2024

@mytang0 The data that SDK gets maybe is cached data. so need the way to know the data.

from nacos.

hxy1991 avatar hxy1991 commented on August 25, 2024

When the Nacos service hangs or there is a problem with the network connection, some corresponding logs will be recorded in "${user.home}/logs/nacos/".

config.log

# Recording client failed to get config from server
01 2018-12-26 19:48:29.222 WARN [main :c.a.n.c.c.NacosConfigService] [fixed-localhost_8848] [] [] [get-config] get from server error, dataId=test, group=nacos, tenant=, msg=ErrCode:500,ErrMsg:no available server
# Recording client used local cached data
01 2018-12-26 19:48:29.223 WARN [main :c.a.n.c.c.NacosConfigService] [fixed-localhost_8848] [] [] [get-config] get snapshot ok, dataId=test, group=nacos, tenant=, config=

# Recording client failed to listen config from server
01 2018-12-26 19:48:29.221 ERROR [main :c.a.n.c.c.i.ClientWorker] [fixed-localhost_8848] [] [NACOS-XXXX] [sub-server] get server config exception, dataId=test, group=nacos, tenant=, msg=java.net.ConnectException: no available server
01 2018-12-26 19:48:29.239 ERROR [com.alibaba.nacos.client.Worker.longPullingfixed-localhost_8848:c.a.n.c.c.i.ServerHttpAgent] [] [] [NACOS ConnectException] currentServerAddr:localhost:8848
01 2018-12-26 19:49:29.442 ERROR [com.alibaba.nacos.client.Worker.longPullingfixed-localhost_8848:c.a.n.c.c.i.ClientWorker] [fixed-localhost_8848] [] [NACOS-XXXX] [check-update] get changed dataId exception, msg=java.net.ConnectException: no available server

naming.log

# Recording client failed to update service info from server
01 2018-12-26 19:50:49.976 WARN [com.alibaba.nacos.client.naming.updater:c.a.n.c.naming] [] [] [] failed to request http://localhost:8848/nacos/v1/ns/api/srvIPXT?dom=test&clientIP=30.5.125.77&udpPort=65117&encoding=UTF-8& from 127.0.0.1
01 2018-12-26 19:50:49.977 ERROR [com.alibaba.nacos.client.naming.updater:c.a.n.c.naming] [] [] [NA] failed to request
java.net.ConnectException: Connection refused (Connection refused)
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:589)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)

If you want to output logs to stdout, you can configure the log configuration file (logback.xml) as follows:

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
        <Pattern>%date %level %msg%n%n</Pattern>
        <charset>UTF-8</charset>
    </encoder>
</appender>

<logger name="com.alibaba.nacos.client.config.NacosConfigService">
    <appender-ref ref="STDOUT"/>
    <level value="WARN"/>
</logger>

<logger name="com.alibaba.nacos.client.config.impl.ClientWorker">
    <appender-ref ref="STDOUT"/>
    <level value="WARN"/>
</logger>

from nacos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.