Re: REST API endpoint for accessing application logs
Rohit Kumar
The API endpoint to get recent logs is present on the loggregator
toggle quoted message
Show quoted text
trafficontroller. You can get the URL for your traffic controller by running: cf curl /v2/info | jq .doppler_logging_endpoint Note that, the URL which you get back will have a "wss" spec, but you will need to use "https" when you issue a recentlogs request. To get the recent logs for your application, you should issue a GET request to https://<trafficontroller URL>/apps/<appid>/recentlogs . You will also need to provide your CF oauth token as part of the "Authorization" header for this request. For example: curl -k -H "Authorization: $(cf oauth-token | grep bearer)" https://doppler.bosh-lite.com:443/apps/$(cf app appName --guid)/recentlogs The response body will contain the log messages in the dropsonde-protocol <https://github.com/cloudfoundry/dropsonde-protocol>format, so you will need to parse them. If you are using Go to do this an easier way would be to use the NOAA library to get recentlogs <https://github.com/cloudfoundry/noaa/blob/master/sample/main.go#L17-L29>. Rohit On Tue, Oct 13, 2015 at 6:11 AM, Ponraj E <ponraj.e(a)gmail.com> wrote:
Hi, |
|