# Advanced Live tail guide

## Live tail message format

Live tail output of each source can be customized in [Live tail](https://telemetry.betterstack.com/team/0/tail ";_blank") by clicking on the `⋯` icon next to the **Message column** header and selecting **Configure**:

![Configuring Logs & traces message format](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/fba102ef-080f-463c-c5b4-1a53116d7a00/md2x =3704x1702)

The Live tail message format is a freeform text template with columns wrapped in `{column}` brackets.

```
[label Live tail message format example]
LEVEL: {level}, PID: {context.system.pid}, THREAD: {context.runtime.thread_id}
```

Conditional rendering can be achieved by piping multiple values

```
[label Live tail message format with conditional fields]
LEVEL: {level}, THREAD or PID: {context.runtime.thread_id|context.system.pid}
```

If you have special characters in your fields such as dots, you can use square brackets instead:

```
[label Live tail message format accessing "thread.id" field in "context"]
LEVEL: {level}, THREAD: {context["thread.id"]}
```

![Example of Live tail message format](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/82cab493-4e89-426d-acff-0d7d66ef3500/orig =3704x2782)

[info]
#### Need to change the message format for multiple sources?

You can also configure the format in [Sources](https://telemetry.betterstack.com/team/0/sources ";_blank") -> Configure -> Advanced settings, by using bulk updates in the [Sources](https://telemetry.betterstack.com/team/0/sources ";_blank") list, or using the [Update Source API](https://betterstack.com/docs/logs/api/update-source/).
[/info]

### Aliases for fields

You can define aliases for fields to make your log messages more readable, especially for deeply nested properties or fields with long names. Use the `as` keyword within the curly braces:

```
[label Live tail message format with aliases]
{syslog.parameters.nested.object.id as my_id} {message}
```

This will display the value of `syslog.parameters.nested.object.id` under the alias `my_id` in your Live tail.

## Colors

You can format and color your logs using a subset of [ANSI codes](https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797) in your log messages.

For example, this is how you could format your logs using our [JavaScript client](https://betterstack.com/docs/logs/javascript/install/):

```js
[label Log formatting example]
logger.info("Logs can be \u001B[1mbold\u001B[0m, \u001B[31mred\u001B[0m, or \u001B[1;32mbold green\u001B[0m.");
```

Here's the result you would see in [Live tail](https://telemetry.betterstack.com/team/0/tail ";_blank"):

![live-tail.png](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/66213042-02c0-4524-ae2a-439f58e00a00/md1x =1472x300)


### Supported colors

Logs & traces supports `31-36` and `91-96` code ranges for colors in both light and dark themes.

### Supported font styles

- Bold: ANSI code `1`
- Light: ANSI code `2`
- Italic: ANSI code `3`
- Underline: ANSI code `4`

### Style reset

Each font color or style needs to be reset by `reset all modes` (`0`) ANSI code. Better Stack Logs & traces doesn't support resetting a color or a style by starting a new one.


### Colors in non-message fields

Logs & traces automatically recognizes and renders ANSI color codes in your main message content. However, when you want to display colors in other fields (like custom fields, context data, or structured log properties), you need to explicitly tell Logs & traces to treat them as text that may contain color formatting.

Use the `::text` syntax to enable color rendering in non-message fields:

```
[label Example with color formatting in custom fields]
{custom.msg::text}
```

### Coalescing fields with colors

When using coalescing (the `|` operator), add `::text` at the end of the entire field expression:

```
[label Coalescing with color formatting]
{message_json.msg|message::text}
```

Note that `::text` applies to the whole coalesced field, not individual parts.

## Other settings

You can customize your [Live tail](https://telemetry.betterstack.com/team/0/tail ";_blank") view by clicking the **gear icon** in the upper right corner.

For example, you can hide the histogram on the top of the page, make the layout denser, or change the way longer log messages are displayed:

![Xnapper-2025-09-18-16.50.51.png](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/657feb7a-00fb-4c8c-8542-b66479e91700/lg2x =3704x1204)
