Logging

You can ensure your gateway is actively exchanging messages with your local blockchain node and the BDN network by monitoring your gateway and inspecting logs.

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.

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, BSC-Mainnet, or Polygon-Mainnet> \
  --ws --port 1801 \ 
  --txtrace \
  --enodes enode://<BLOCKCHAIN_NODE_PUBLIC_KEY>@<NODE_IP>:<NODE_PORT>
  

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:

Gateway ParameterDescriptionValue

txtrace-max-file-size

Sets max size (megabytes) of individual log files

integer [Default: 100]

txtrace-max-files

Sets max number of log files stored

integer [Default: 3]

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.

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.

Last updated