spawnctl, you can get the logs of a running data container.
NOTE: This command only works on Spawn V2.
$ spawnctl logs data-container <ContainerName_Or_ContainerID>
In this tutorial we will create a Data Image and then use it to create a Data Container. Then, we will get the logs of that data container.
As a prerequisite you should've followed the instructions to install spawnctl
Create a file
development.yamlwith your Data Image specifications.
sourceType: empty name: dev engine: postgresql
In this case we want to create a PostgreSQL Data Image that is completely empty and is named
Run the following command to create a Data Image.
$ spawnctl create data-image -f ./development.yaml Data image 'dev' created!
You can verify your Data Image by running the following command.
$ spawnctl get data-images NAME IMAGE ID ENGINE STATUS MESSAGE CREATED dev 10001 PostgreSQL 2 Created 2 minutes ago
Create a Data Container from the newly created Data Image.
$ spawnctl create data-container --image dev Data container 'dev-rambbomj' created! -> Host=instances.spawn.cc;Port=53223;User ID=<some_user_id>;Password=<some_password>;
You can verify your Data Container was properly created by running the following command.
$ spawnctl get data-containers NAME CONTAINER ID REVISION STATUS MESSAGE ENGINE CREATED dev-rambbomj 10001 rev.0 2 Running PostgreSQL 1 minute ago
You can now get the logs of the data container using the
spawnctl logs data-containercommand.
$ spawnctl logs data-container dev-rambbomj 2019-08-19 12:10:45.302 UTC  LOG: listening on IPv4 address "0.0.0.0", port 5432 2019-08-19 12:10:45.302 UTC  LOG: listening on IPv6 address "::", port 5432 2019-08-19 12:10:45.306 UTC  LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2019-08-19 12:10:45.358 UTC  LOG: database system was interrupted; last known up at 2019-08-19 12:10:23 UTC 2019-08-19 12:10:46.670 UTC  FATAL: the database system is starting up 2019-08-19 12:10:49.679 UTC  FATAL: the database system is starting up 2019-08-19 12:10:52.009 UTC  LOG: database system was not properly shut down; automatic recovery in progress 2019-08-19 12:10:52.026 UTC  LOG: invalid record length at 0/1652570: wanted 24, got 0 2019-08-19 12:10:52.026 UTC  LOG: redo is not required 2019-08-19 12:10:52.065 UTC  LOG: database system is ready to accept connections