Retrieving Diagnostic and Log Information

  • reference
    Diagnostic information can be retrieved by using the GET method with the /diag URI. The current content of a log file can be returned by using GET with the /sasl_logs URI.

    HTTP method and URIs

    GET /diag
    GET /sasl_logs/<log-name>


    The GET /diag method and URI return general Couchbase-Server diagnostic information. This requires the Full Admin, the Cluster Admin, or the Local User Security Admin role.

    The GET /sasl_logs method and URI return the contents of a Couchbase-Server log file. This requires the Full Admin or the Cluster Admin role.

    For general information on logging and log files, including the location of log files and descriptions of their content, see Manage Logging.

    Curl Syntax

    curl -X GET -u <username>:<password>
    curl -X GET -u <username>:<password>

    The log-name argument should be the name of a Couchbase-Server log file that is present in the directory used for saving log files on the specified node. For the per-platform default locations for saving log files, see the page Manage Logging. For a complete list of log files, see Log File Listing.

    If no log-name argument is specified, the default value is debug; whereby the contents of the debug.log file are displayed.


    For both URIs, success gives 200 OK, and displays the returned content. Failure to authenticate gives 401 Unauthorized. When GET /sasl_logs is used, a log-name that is incorrectly specified, or corresponds to a log file that does not currently exist, gives 404 Object Not Found.


    The following examples show how to return diagnostic information and log-file content.

    Returning Diagnostic Information

    The following example uses GET /diag to return Couchbase-Server diagnostic information:

    curl -v -X GET -u Administrator:password

    If successful, this returns (extensive) output whose initial section resembles the following:

    2020-02-07T04:30:30.429-08:00, ns_cookie_manager:3:info:cookie update(ns_1@cb.local) - Initial otp cookie generated: {sanitized,
    2020-02-07T04:30:30.580-08:00, menelaus_sup:1:info:web start ok(ns_1@cb.local) - Couchbase Server has started on web port 8091 on node 'ns_1@cb.local'. Version:
    2020-02-07T04:30:30.816-08:00, mb_master:0:info:message(ns_1@cb.local) - I'm the only node, so I'm the master.
    2020-02-07T04:30:30.880-08:00, compat_mode_manager:0:warning:message(ns_1@cb.local) - Changed cluster compat mode from undefined to [6,5]
    2020-02-07T04:30:30.937-08:00, memcached_config_mgr:0:info:message(ns_1@cb.local) - Hot-reloaded memcached.json for config change of the following keys: [<<"cli

    Returning Log-File Content

    The following example uses GET /sasl_logs with the stats endpoint, to return the contents of the stats.log log file:

    curl -v -X GET -u Administrator:password

    If successful, this returns (extensive) output, whose initial section resembles the following:

    logs_node (stats.log):
    [ns_doctor:debug,2020-02-07T04:30:30.602-08:00,ns_1@cb.local:ns_doctor<0.354.0>:ns_doctor:handle_info:182]Got initial status:
              <<"MemTotal:        1016332 kB\nMemFree:

    See Also

    General information on logging and log files, including locations and descriptions of all log files, is provided in Manage Logging.