> For the complete documentation index, see [llms.txt](https://docs.bloxroute.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bloxroute.com/bsc/gateway/hosted-and-local-gateways/logging.md).

# Logging

### **Setting log level**

Use the parameter **`log-file-level`** to configure the amount of data logged in the Gateway log file, and use **`log-level`** to configure the amount of data logged to standard output.

The Gateway’s common log levels and the possible values for these two flags are listed below in order from most verbose (TRACE) to least verbose (ERROR). The default log level is INFO.

```
TRACE, DEBUG, INFO, WARN, ERROR
```

#### **Accessing the log files**

The log files can be found in the **`logs`** directory of the Docker container (as specified with the Docker command or the startup script). The most recent log file is named `gateway-[external port of gateway].log`.

Older log files are named `gateway-[external port of gateway]-[end timestamp].log`**.**

### **Analyzing transaction receipt**

Your Local Gateway includes a logging utility that helps you analyze when the gateway received important transactions and the source of such transactions.

For each transaction received, the utility records the time the transaction is first received by the gateway and the source from which the gateway received it. To enable this utility, add the parameter `txtrace` to your startup argument when you start the gateway.

{% tabs %}
{% tab title="Docker Argument" %}

```bash
docker run --name bxgateway-go -d \
  -v <LOG_FILE_PATH>:/app/bloxroute/logs \
  -v <SSL_CERT_PATH>:/app/bloxroute/ssl \
  -p 1801:1801 -p 28333:28333 bloxroute/bloxroute-gateway-go \ 
  --blockchain-network <Mainnet, or BSC-Mainnet> \
  --ws --port 1801 \ 
  --txtrace \
  --enodes enode://<BLOCKCHAIN_NODE_PUBLIC_KEY>@<NODE_IP>:<NODE_PORT>
  
```

{% endtab %}
{% endtabs %}

#### **Log format and size**

Each `txtrace` entry is logged in the following format:

`time="[Time Tx Received]" level=trace msg="[Tx Hash] - [Blockchain or BDN] [Source IP]"`

The `txtrace` utility has additional parameters that allow you to control the size of the log file:

<table><thead><tr><th>Gateway Parameter</th><th width="351.3333333333333">Description</th><th>Value</th></tr></thead><tbody><tr><td><strong><code>txtrace-max-file-size</code></strong></td><td>Sets max size (megabytes) of individual log files</td><td>integer<br><em>[Default: 100]</em></td></tr><tr><td><strong><code>txtrace-max-files</code></strong></td><td>Sets max number of log files stored</td><td>integer<br><em>[Default: 3]</em></td></tr></tbody></table>

#### **Accessing `txtrace` log files**

Similar to other logs, the `txtrace` log files are also located in the **`logs`** directory.

The most recent file is named `txtrace-gateway-[external port of gateway].log`.

Older `txtrace` log files are named `txtrace-gateway-[external port of gateway]-[end timestamp].log`**.**

{% hint style="info" %}
The txtrace log is not a substitute for the Tx-Trace service which allows traders to gain insight on transaction propagation by the BDN.

More information about this service, can be found [here](/eth/sending-transactions/tx-trace.md).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.bloxroute.com/bsc/gateway/hosted-and-local-gateways/logging.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
