Open jscyo opened 1 year ago
We want to use log streaming.
The webhook method is where we ask them to give us an HTTP URL. The core would call that URL and stream some log info to it. This allows the user to choose any service to consume the logs.
Can you achieve webhook behavior with logspout.
What would the output look like? Can you configure the output in logspout
Also how often should logs be sent?
Should there be config options to filter logs?
Logspout is a log router that runs as a docker container and listens to other docker images and can steam logs to popular services like AWS cloudwatch, elastic search, and papertrail or any syslog servers.
Running the following will create an endpoint http://localhost:3000/logs
which will stream logs
docker run -d --name="logspout" \
--volume=/var/run/docker.sock:/var/run/docker.sock \
--publish=127.0.0.1:3000:80 \
gliderlabs/logspout
This can be tested by running the above command and then running curl http://localhost:3000/logs
, if you now run the supertokens core you should see the following:
Logspout allows you to create filters to filter logs per container name/label/sources
The main purpose of logspout is to route logs to services like papertrail or aws cloudwatch by supplying a syslog tls endpoint from the service.
For example, connecting with paper trail:
$ docker run --name="logspout" \
--volume=/var/run/docker.sock:/var/run/docker.sock \
gliderlabs/logspout \
syslog+tls://logs.papertrailapp.com:55555
As mentioned in their docs, you should be able to customize the format for the logs
How other Auth providers handle logging:
Auth0:
There are 3 methods for consuming Auth0 logs:
FusionAuth
Tools we can use:
Configure docker's logging driver:
logsput
A popular library that allows for log streaming, can integrate with papertrail
Notes: