Logs
Logs are generated by various components of the stack:
- The runtime (PHP, nodejs, etc.).
- The application.
- CronJobs.
- CDN.
- Deployments.
These logs are aggregated in AWS CloudWatch - see and can also be streamed in terminal by using the skpr client see skpr logs usage.
Configuration
Applications need to output their logs to stdout
- this ensures the container orchestrator can aggregate logs and ship them to the storage backend. The Twelve-Factor App manifesto describes this succinctly:
A twelve-factor app never concerns itself with routing or storage of its output stream. It should not attempt to write to or manage logfiles. Instead, each running process writes its event stream, unbuffered, to
stdout
.
Drupal 10 or higher
- Enable and configure the Skpr Logs module
- To install Skpr Logs module via composer, run:
composer require 'drupal/skpr_logs:^1.0'
Other
Other applications which log to stdout
will log to AWS CloudWatch as well.
Examples of this might include Solr, ElasticSearch, MailHog or one of the various smaller service applications
which might be utilised.
If you're using Drupal 7, be sure to enable log_stdout and disable any other logging modules such as dblog or syslog.
More Information
$ skpr logs --help
usage: skpr logs <command> [<args> ...]
Commands for interacting with logs
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
Args:
logs tail [<flags>] <environment> [<stream>...]
Follow a stream of logs
What's next?
After looking through the logs, consider one of the following: