This topic describes how to obtain logs from a Nacos client.
Procedure
The logs of a Nacos client vary based on the programming language. The following content describes how to obtain logs from Nacos clients in different programming languages.
Java Nacos client
In most cases, logs of a Java Nacos client is saved in the ${user.home}/logs/nacos/ directory of the node where the application service is located. ${user.home} specifies the root directory of the system user who starts the application service process.
If your applications are Spring Cloud applications, log configurations of a Nacos client may be overwritten by applications in earlier versions of Spring Cloud. As a result, logs of the Nacos client are displayed in the logs of your application services.
The naming.log file is the log file related to a registry. The config.log file is the log file related to a configuration center. The remote.log file is added to the Nacos client in a version later than Nacos 2.0.0 and stores the logs related to gRPC connections.
Go Nacos client
By default, the logs of a Go Nacos client are saved in the /tmp/nacos/log/ directory. You can configure the LogDir:
parameter to change the directory in which logs are saved.
All logs of a Go Nacos client are saved in a single log file.
Python Nacos client
A Python Nacos client uses the logging module of Python, which is consistent with the logging module of your application. Logs of a Python Nacos client are displayed in application logs.
C++ Nacos client
By default, the logs of a C++ Nacos client are saved in the directory in which your application is located. The log file is named nacos-sdk-cpp.log. You can set the log directory by using setBaseDir in the Logger.cpp file.
C# Nacos client
When a C# Nacos client is initialized, ILoggerFactory of Microsoft.Extensions.Logging must be passed. Logs are displayed based on application log settings. By default, logs of a C# Nacos client are displayed with application logs.