Accessing application logs

Application logs will give you insights into what is happening inside the deployed components. To access the logs, select an application from the deployed ones, and click on the Logs tab.

Each log line displays the Kubernetes pod identifier in dark grey color, the component name in purple, the timestamp in light grey, and the log text in white. Logs may be refreshed anytime by using the refresh button in the top right corner of the logs board, right beside the Filter by component dropdown, which will reload the logs. Also, newer logs can be loaded using the Load more button, (always at the bottom of the logs list), and will be added as the last elements of the list. If there are no new logs to load, the system will display a notification.

App logs

App logs features

The user is enabled to search for any text in the logs by using the browser find feature (using Ctrl + F shortcut in Windows, Linux and ChromeOS, or Cmd + F in Mac). The logs board also provides filtering features that can be used by typing a keyword in the input text box with the text Type to filter by term (the term has to be longer than 3 characters), selecting a component in the Filter by component dropdown list, or combining both methods. To clear the term filter, the user may delete the keyword from the input text, or click on the x button of the displayed contextual notification that shows the number of logs available from the filtering. Logs filter by term notification To clear the component filter, the user has to open the dropdown and click on the clean filter button that appears at the bottom of the list.

Logs filter by component dropdown

Logs settings

In the application, users have the flexibility to customize the visibility of specific fields in the logs for a more tailored viewing experience. Users can navigate to the log settings to access these customizable options, using the settings button Logs filter by term notification on the top right, beside the filter by component dropdown.

Logs detail

App logs detail

Within the settings, there is an option to enable or disable the display of various fields such as the Kubernetes pod name, the component name, and the timestamp. Toggling these options will either show or hide the respective information in the log entries, allowing users to view only the most relevant details. Additionally, in the log settings, there is also a feature to process ANSI escape codes. When enabled, this feature allows the logs to display text attributes such as colors and formats as defined by the ANSI codes, enhancing the readability and visual differentiation of the log entries.

Logs settings

Accessing logs using the CLI

Alternatively, applications logs can be also consumed through the CLI using:

playground apps logs <appName> 
[comp-1-864b6b49-f47l8]    [comp-1]    2021-04-20T19:12:09.401703900Z 2021-04-20 19:12:09+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
[comp-1-864b6b49-f47l8]    [comp-1]    2021-04-20T19:12:09.694353300Z 2021-04-20 19:12:09+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
[comp-1-864b6b49-f47l8]    [comp-1]    2021-04-20T19:12:09.703567900Z 2021-04-20 19:12:09+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
[comp-1-864b6b49-f47l8]    [comp-1]    2021-04-20T19:12:09.998947300Z 2021-04-20 19:12:09+00:00 [Note] [Entrypoint]: Initializing database files
[comp-1-864b6b49-f47l8]    [comp-1]    2021-04-20T19:12:10.089821100Z 2021-04-20T19:12:10.084794Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
[comp-1-864b6b49-f47l8]    [comp-1]    2021-04-20T19:12:11.824240300Z 2021-04-20T19:12:11.823032Z 0 [Warning] InnoDB: New log files created, LSN=45790
[comp-1-864b6b49-f47l8]    [comp-1]    2021-04-20T19:12:12.003747300Z 2021-04-20T19:12:12.003462Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
[comp-1-864b6b49-f47l8]    [comp-1]    2021-04-20T19:12:12.063374000Z 2021-04-20T19:12:12.062918Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 4f6aa729-a20c-11eb-811a-8a4a70cada5e.
[comp-1-864b6b49-f47l8]    [comp-1]    2021-04-20T19:12:12.065024200Z 2021-04-20T19:12:12.064740Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
...
[comp-2-6fdbdbf9b8-p4nsg]    [comp-2]    2021-04-20T19:12:34.552046300Z
[comp-2-6fdbdbf9b8-p4nsg]    [comp-2]    2021-04-20T19:12:34.552069700Z MySQL Connection Error: (2002) Connection refused
[comp-2-6fdbdbf9b8-p4nsg]    [comp-2]    2021-04-20T19:12:37.553334700Z
[comp-2-6fdbdbf9b8-p4nsg]    [comp-2]    2021-04-20T19:12:37.553374400Z
[comp-2-6fdbdbf9b8-p4nsg]    [comp-2]    2021-04-20T19:12:37.553687500Z MySQL Connection Error: (2002) Connection refused
[comp-2-6fdbdbf9b8-p4nsg]    [comp-2]    2021-04-20T19:12:37.553499100Z Warning: mysqli::__construct(): (HY000/2002): Connection refused in Standard input code on line 22

Use the –follow (-f) flag to print the log messages as they are received

Additionally, you may retrieve logs for a single application component using:

playground apps logs appName/comp-1 
[comp-1-864b6b49-f47l8]    [comp-1]    2021-04-20T19:12:09.401703900Z 2021-04-20 19:12:09+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
[comp-1-864b6b49-f47l8]    [comp-1]    2021-04-20T19:12:09.694353300Z 2021-04-20 19:12:09+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
[comp-1-864b6b49-f47l8]    [comp-1]    2021-04-20T19:12:09.703567900Z 2021-04-20 19:12:09+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
[comp-1-864b6b49-f47l8]    [comp-1]    2021-04-20T19:12:09.998947300Z 2021-04-20 19:12:09+00:00 [Note] [Entrypoint]: Initializing database files
[comp-1-864b6b49-f47l8]    [comp-1]    2021-04-20T19:12:10.089821100Z 2021-04-20T19:12:10.084794Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
[comp-1-864b6b49-f47l8]    [comp-1]    2021-04-20T19:12:11.824240300Z 2021-04-20T19:12:11.823032Z 0 [Warning] InnoDB: New log files created, LSN=45790
[comp-1-864b6b49-f47l8]    [comp-1]    2021-04-20T19:12:12.003747300Z 2021-04-20T19:12:12.003462Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
[comp-1-864b6b49-f47l8]    [comp-1]    2021-04-20T19:12:12.063374000Z 2021-04-20T19:12:12.062918Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 4f6aa729-a20c-11eb-811a-8a4a70cada5e.
[comp-1-864b6b49-f47l8]    [comp-1]    2021-04-20T19:12:12.065024200Z 2021-04-20T19:12:12.064740Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.

What’s next