Logs data-container
Overview
Using spawnctl
, you can get the logs of a running data container.
Command
$ spawnctl logs data-container <ContainerName_Or_ContainerID>
Tutorial
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.yaml
with your Data Image specifications.sourceType: empty name: dev engine: postgresql version: 11.0
In this case we want to create a PostgreSQL Data Image that is completely empty and is named
dev
.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-container
command.$ spawnctl logs data-container dev-rambbomj 2019-08-19 12:10:45.302 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 2019-08-19 12:10:45.302 UTC [1] LOG: listening on IPv6 address "::", port 5432 2019-08-19 12:10:45.306 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2019-08-19 12:10:45.358 UTC [21] LOG: database system was interrupted; last known up at 2019-08-19 12:10:23 UTC 2019-08-19 12:10:46.670 UTC [22] FATAL: the database system is starting up 2019-08-19 12:10:49.679 UTC [23] FATAL: the database system is starting up 2019-08-19 12:10:52.009 UTC [21] LOG: database system was not properly shut down; automatic recovery in progress 2019-08-19 12:10:52.026 UTC [21] LOG: invalid record length at 0/1652570: wanted 24, got 0 2019-08-19 12:10:52.026 UTC [21] LOG: redo is not required 2019-08-19 12:10:52.065 UTC [1] LOG: database system is ready to accept connections