Logs collect the output of your Containers. Aptible provides logs in three forms:
- CLI Logs: Logs available in the CLI, best for accessing recent App & Database logs on the fly
- Log Drains: Logs routed to a destination of your choice, best for searching and alerting
- Log Archiving: Logs routed to S3, best for business continuity and compliance
🧠 Advanced Tip: Strictly speaking,
stderrare captured. If you are using Docker locally, this is what you'd see when you run
docker logs .... Most importantly, this means logs sent to files are not captured by Aptible logging, so when you deploy your Apps on Aptible, you should ensure you are logging to
stderr, and not to log files.
App and Database logs can be accessed in real-time from the CLI using the
aptible logs command. For example:
aptible logs--app "$APP_HANDLE" aptible logs--database "$DATABASE_HANDLE"
aptible logsdoes not retain logs for the long term. If you have a requirement to retain logs, you will need to set up a Log Drain.
Log Drains let you route Logs to logging destinations for reviewing, searching, and alerting. Log Drains support capturing logs for Apps, Databases, SSH sessions, and Endpoints. Refer to Log Drains for more information.
Log Archiving lets you route Logs to S3 for business continuity and compliance. Log Archiving supports capturing logs for Apps, Databases, SSH sessions, and Endpoints. Refer to Log Archiving for more information.