Re: REST API endpoint for accessing application logs

Rohit Kumar

The API endpoint to get recent logs is present on the loggregator
trafficontroller. You can get the URL for your traffic controller by

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)"$(cf app appName --guid)/recentlogs

The response body will contain the log messages in the 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


On Tue, Oct 13, 2015 at 6:11 AM, Ponraj E <ponraj.e(a)> wrote:


I want to get the application's dumped logs from the loggregator and not
the tailing logs.
CLI provides me a command to do it: cf logs APP_NAME --recent displays
all the lines in the Loggregator buffer.

But how do I do it via REST API endpoint? I had set the CF_TRACE=true to
see the REST calls thats been fired to get the application log, but I see
only the GET call to get the application details, but after that it just
dumps the log.

Thanks for the help.


Join to automatically receive all group messages.