Saturday, February 17, 2018

Log drain (log management service - Logit)


CF aggregates the logs from all the instances and make them available whenever you say cf logs <app name>
This displays logs from all the instances in the app. 

However this only shows the recent logs and if you want to view more logs, then you have to drain the logs to a log management services

Steps to stream logs to a log management service: 

1: Log service configuration. 
a. Go to the third party log service provider, signup. 
https://logit.io/
d. Get the syslog url provided by the third party service. 

2: Create a User provided service instance. 
a. create CUPS -l <syslog url>
$cf cups logit-ssl-drain -l syslog-tls://d0cde9b8-8275-41f8-bccf-af38173c62e7-ls.logit.io:21298

b. Bind the service instance to the app that needs logging. 
$cf bind-service userservice logit-ssl-drain

3: Verify the logs
Go to your service provider and view the logs. 



No comments:

Post a Comment