Re: REST API endpoint for accessing application logs


Warren Fernandes
 

Hi Ponraj,

For #1
The guid that gets printed out is the boundary for the multi-part message. When we serve the recent logs we create a multipart writer here(https://github.com/cloudfoundry/loggregatorlib/blob/master/server/handlers/http_handler.go#L23) which creates a random boundary here (https://golang.org/src/mime/multipart/writer.go?s=470:505#L29). You can see this in the headers if you run the curl command with a -v flag.

For #2
I'm guessing since the content type is set to "multipart/x-protobuf", the data might not be getting decoded properly. However, if you use the noaa library we unmarshal the data correctly here (https://github.com/cloudfoundry/noaa/blob/master/consumer.go#L333)

For #3
The error you are getting is from the net/url package here (https://golang.org/src/net/url/url.go#L417) which is called when we do a ParseURIRequest here (https://github.com/cloudfoundry/noaa/blob/master/consumer.go#L212). I even tried various ways to get that error in the playground (http://play.golang.org/p/tOeuyTxnb_). The only way I could replicate your error easily was to include the quotes in the doppler address. I'm hoping this is not a Windows thing because my testing happens to be on Mac OS X.

Hope this helps.

Join cf-dev@lists.cloudfoundry.org to automatically receive all group messages.