# How to log basic Text Output

One of the simplest methods to monitor and log the state of your application is by printing text information to the standard output or standard error. For example, you can implement the following loop to continuously output an increasing integer every second:

```cpp
#include <iostream>
#include <unistd.h>

int main() {
    int i = 0;
    while (true) {
        std::cout << i++ << std::endl;
        sleep(1);
    }
}
```

## Viewing Logs via the Vehicle Web UI

You can then view the application standard output by visiting the [Apps page](/vehicle-operation/settings-and-maintenance/vehicle-dashboard.md#apps) of the Vehicle Web UI. Click the cog icon at the top-right corner of your application widget, and select **Logs:**

<figure><img src="/files/QInPcoP0d4BxJ8sEomw3" alt=""><figcaption><p>Accessing the logs of an application via the Vehicle Web UI</p></figcaption></figure>

This will open a new panel containing the logs of your application:

<figure><img src="/files/6zlLRrpnBdJErE8MOZzf" alt=""><figcaption></figcaption></figure>

## Viewing Logs via the Command Line

Alternatively, you can use the [Auterion CLI ](/app-development/app-development/application-development.md#install-auterion-cli)tool to view the app logs. You can list the available applications with:

```bash
$ auterion-cli app list
App name                         Version    App status    App enable (autostart)    Service name        Service status    Service enable (autostart)    SSH port
-------------------------------  ---------  ------------  ------------------------  ------------------  ----------------  ----------------------------  ----------
com.auterion.app-base-v2         v2         stopped       disabled                  base-image          exited            exited                        None
com.auterion.example-app         0.0.1      running       enabled                   example-app         running           running                       None
com.auterion.precision-delivery  1.4.18     running       enabled                   precision-delivery  running           running                       None
com.auterion.video2ros           0.5.0      restarting    enabled                   add-file            running           running                       14114
└─                         
```

Then access the desired app logs by specifying its name as done in the following command:

```bash
$ auterion-cli app logs -f com.auterion.example-app
com.auterion.example-app.example-app  | [example_app-1] 0
com.auterion.example-app.example-app  | [example_app-1] 1
com.auterion.example-app.example-app  | [example_app-1] 2
```

Use the `-f` flag to follow the logs as more outputs arrive. Alternatively `-a` to show all available logs.

## Log Files and Suite Display

Any write to stdout and stderr from apps is also added to the ulog file, and displayed in the suite. Here's an example:

<figure><img src="/files/xkln85y247ZyizbF0G1R" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
To prevent message spamming, there is a rate limitation filter. If an application outputs too many messages at once, additional messages are dropped and a message in the form of `throttle: dropping data for '<app>'`
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.auterion.com/app-development/app-framework/logging/logging-text-output.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
