Deployment
Syslogs
Native convox logging information can be found here…
Routing Logs to a 3rd Party
Convox supports routing your logs to any third party that can accept data from a syslog forwarder.
You can create a syslog forwarder with the following command:
$ convox rack resources create syslog [destination]
For example:
$ convox rack resources create syslog Url=tcp+tls://logs1.papertrailapp.com:12345
Creating syslog-3785 (syslog)... CREATING
Additionally, you can pass a Format
parameter to amend the default logging format to match the requirements of your receiving service.
For example for Datadog:
$ convox rack resources update syslog-3785 Format="123457890abcdef1234567890 <22>1 {DATE} {GROUP} {SERVICE} {CONTAINER} - - [metas ddsource=\"{GROUP}\" ddtags=\"container_id:{CONTAINER}\"] {MESSAGE}" Url=tcp+tls://intake.logs.datadoghq.com:10516
The {DATE} / {GROUP} / {SERVICE} / {CONTAINER} / {MESSAGE}
variables within the format are dynamically replaced with the correct values and injected into the log output in the required format.
You can view the forwarder setup at any time using convox rack resources info
$ convox rack resources info syslog-3785
Name syslog-3785
Status running
Options Format=<22>1 {DATE} {GROUP} {SERVICE} {CONTAINER} - - {MESSAGE}
Url=tcp+tls://logs1.papertrailapp.com:12345
URL tcp+tls://logs1.papertrailapp.com:12345
In order to start sending logs from an app to the forwarder you need to link it to the app with convox rack resources link
$ convox rack resources link syslog-3785 --app example
Linked syslog-3786 to example
Some common 3rd party logging services include:
-
- Go to Log Destinations to get the forwarding destination
- The Default
Format
is suggested. (<22>1 {DATE} {GROUP} {SERVICE} {CONTAINER} - - {MESSAGE}
)
-
- Go to Syslog-Ng Integration to check the forwarding destination. This currently differs between the US site (
intake.logs.datadoghq.com:10516
) and the EU site (tcp-intake.logs.datadoghq.eu:443
) - Suggested
Format="INSERT-YOUR-API-KEY-HERE <22>1 {DATE} {GROUP} {SERVICE} {CONTAINER} - [metas ddsource=\"{GROUP}\" ddtags=\"container_id:{CONTAINER}\"] {MESSAGE}"
where you replaceINSERT-YOUR-API-KEY-HERE
with your Datadog API key 😉
- Go to Syslog-Ng Integration to check the forwarding destination. This currently differs between the US site (
-
- Go to https://app.logdna.com/pages/add-source, select Syslog as your provider and then use the provided url as the syslog resource Url (with
tcp+tls://
) - Suggested
Format="<22>1 {DATE} {GROUP} {SERVICE} {CONTAINER} {MESSAGE}"
- Go to https://app.logdna.com/pages/add-source, select Syslog as your provider and then use the provided url as the syslog resource Url (with
-
- Syslog configuration is documented here
- Suggested
Format="<22>1 {DATE} {GROUP} {SERVICE} {CONTAINER} - [INSERT-YOUR-CUSTOMER-TOKEN-HERE@41058 tag=\"INSERT-YOUR-TAG-HERE\" ] {MESSAGE}"
and replacingINSERT-YOUR-CUSTOMER-TOKEN-HERE
with your Loggly customer token andINSERT-YOUR-TAG-HERE
with a tag that describes your source