0

Is it possible to read the Nexus 2.14 log (the one you see in Administration -> Logging) per http access (REST)?

If not, are there other means to read it from an external program?

Raktim Biswas
  • 4,011
  • 5
  • 27
  • 32
J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142

2 Answers2

0

It seems that

http://localhost:8081/nexus/service/siesta/logging/log

gives you the recent log file (found by trial and error).

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142
0

There's an option to download the logs from the Log tab in Nexus.

Nexus - Download logs]

Once you have downloaded the file, your browser will capture the URL from where it was downloaded, which will be listed in the downloads section of your browser.

Download URL

You can use the below methods to fetch the logs,

  • Fetching the logs using curl:

    curl -u uname:pass http://nexusURL/nexus/service/siesta/logging/log
    
  • Fetching the logs in Node.js using the request module:

    var request = require('request')
    
    var opts = {
        headers: { Authorization: "Basic YWRtaW46YWRtaW4=" },   //For admin:admin
        uri: 'http://nexusURL/nexus/service/siesta/logging/log',
        method: "GET"
    }
    request(opts,function(err, res, body){
            console.log(body)
        }
    );
    
Raktim Biswas
  • 4,011
  • 5
  • 27
  • 32