Setting up a log drain
Nex!™ supports setting up a log drain for sending application logs to another platform (SumoLogic, Splunk, Elasticsearch). All that's required is to specify the URL where logs should be sent to.
1 - Ensure logs are redirected to STDOUT in your Express
See Deploying Express "Logging" section.
2 - Adding a HTTP log drain to your application on Nex!
Just run the command below for your application. If you don't have a log drain URL you should create one first. See the next sections for instructions on how to do that with SumoLogic.
# Add a logdrain for the 'holistic-salmon' app nex-cli apps:update holistic-salmon --http-log-drain https://some-log-platform.com/some-random-log-drain-token # Restart your application for the change to take effect nex-cli apps:restart holistic-salmon
3 - Creating a HTTP Log Drain in SumoLogic
You first need to register a Hosted SumoLogic Collector and use the generated collector URL
- Go to Manage > Collection > Add Collector
- Select "Hosted Collector" (the collector will be hosted by SumoLogic)
- For the name you should use the name of your actual connector for the log drain. E.g.: connector-vend-prd or connector-vend-uat
- SumoLogic then ask the type of collector you want. Select "HTTP"
- Use the same name as the collector for the name of the HTTP endpoint (e.g. connector-vend or connector-vend-uat)
- Select "UTC/Etc" for the timezone
- Once created SumoLogic will display a popup showing the log drain URL. Just copy that and use it for the next step