---
title: "Write JSON logs"
description: "Make the bot write machine readable log lines for log tools such as Loki."
canonical_url: "https://docs.mute.yonn2222.com/monitoring/json-logs"
---
# Write JSON logs

> Make the bot write machine readable log lines for log tools such as Loki.

This page is for people who collect logs with a tool. You can skip it otherwise.

## Turn JSON logs on

Add this line to the bot `config.json`:

```json
"logFormat": "json"
```

The bot then writes one JSON object per line instead of the colored window output.

## Fields

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        time
      </code>
    </td>
    
    <td>
      Time of the message in UTC.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        level
      </code>
    </td>
    
    <td>
      <code>
        info
      </code>
      
      , <code>
        warn
      </code>
      
      , <code>
        error
      </code>
      
      , <code>
        success
      </code>
      
       or <code>
        debug
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        module
      </code>
    </td>
    
    <td>
      The part of the bot that wrote it, for example <code>
        bot
      </code>
      
      , <code>
        mute
      </code>
      
      , <code>
        metrics
      </code>
      
      , <code>
        telemetry
      </code>
      
       or <code>
        updates
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        process
      </code>
    </td>
    
    <td>
      <code>
        gateway
      </code>
      
      , or <code>
        cluster-0
      </code>
      
      , <code>
        cluster-1
      </code>
      
       and so on.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        msg
      </code>
    </td>
    
    <td>
      The message. Tokens and secrets are hidden.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        error
      </code>
    </td>
    
    <td>
      Only present when there is extra detail or an error. Secrets are hidden here too.
    </td>
  </tr>
</tbody>
</table>


## Sitemap

See the full [sitemap](https://docs.mute.yonn2222.com/sitemap.md) for all pages.
