Othentic
  • Introduction
    • Introducing Othentic Stack
    • Use Cases
  • AVS Framework
    • Abstract
    • Quick Start
    • Othentic CLI
      • Key Management
      • Contracts Deployment
      • Operator Registration
      • AVS Logic Implementation
      • Operator Deposit
      • Node Operators
      • Rewards Distribution
      • P2P Config
        • Custom P2P Messaging
        • P2P Auth Layer
        • Metrics and Monitoring
        • Logging
        • Persistent storage
        • Latency
      • CLI Command Reference
    • Smart Contracts
      • AVS Governance
      • Attestation Center
      • Hooks
        • Task Logic
        • Operator Management
        • Rewards Fee Calculator
      • OBLS
      • Othentic Registry
      • Message Handlers
    • Othentic Consensus
      • Abstract
      • Task & Task Definitions
      • Leader Election
      • Proof of Task
      • Execution Service
      • Validation Service
      • Voting Power
      • Rewards and Penalties
      • Internal Tasks
    • FAQ
    • Supported Networks
    • Explainers
      • Networking
      • Multichain
      • Production Guidelines
      • Operator Allowlisting
      • Governance Multisig
  • External
    • AVS Examples
  • GitHub
  • Othentic Hub
Powered by GitBook
On this page
  • Overview
  • Log Levels
  • Logging Destinations
  • 1. Console (default):
  • 2. File:
  • 3. Elasticsearch:
  • Recommendations for Use
  1. AVS Framework
  2. Othentic CLI
  3. P2P Config

Logging

Overview

Logging is essential to any application, providing critical insights into its behavior, aiding debugging, and ensuring seamless monitoring in production environments. Othentic CLI features a robust logging system, offering flexibility to log multiple destinations.

Log Levels

Logs are categorized by severity levels to help identify and filter specific types of messages:

  • info: General information about the application’s operation.

  • debug: Detailed information for debugging purposes. (included only in logs written to a file or sent to Elastic)

  • warn: Indications of potential issues.

  • error: Critical errors affecting the application.

Logging Destinations

Othentic CLI supports the following destinations:

1. Console (default):

Logs are printed directly to the standard output (stdout).

Example:

[2025-01-14 19:12:49] [info] Submitting task signed by operators: 1
[2025-01-21 19:30:49] [warn] Failed to connect to peer 12D3KooWEsKHAZtWxBzqtHazZZN9vgnVo8bewpS6Vwfckub64jiV: TimeoutError: The operation was aborted due to timeout
[2025-01-14 19:13:17] [error] Server not running

2. File:

Logs are written to rotating files in JSON format, making them ideal for historical log analysis and archiving.

Example log entry:

{
  "timestamp":"2025-01-14 19:00:25",
  "version":"1.7.0",
  "level":"info",
  "context":"P2P",
  "message":"Connected to peer: 12D3KooWCVRxMBPYMSk1QNyasXgrTyMbHWGHftAWQRGrWzkGj2Ly"
}

Configuration: Add the following property to your .env file to specify the log directory:

LOG_DIR=<directory-path>

3. Elasticsearch:

Logs are sent to an Elasticsearch instance for storage and advanced analytics.

This is particularly useful in distributed environments where monitoring and querying logs is essential.

Configuration: Add these elasticsearch properties to your .env file:

ELASTIC_URL=<elasticsearch-url>
ELASTIC_USERNAME=<username>
ELASTIC_PASSWORD=<password>

Recommendations for Use

  • Development: Use the console destination for real-time feedback.

  • Production:

    • Configure file-based logging for historical data and compliance requirements.

    • Use Elasticsearch for advanced monitoring and visualization with tools like Kibana.

By leveraging logging capabilities, you can clearly understand the application's operations and quickly address any issues.

PreviousMetrics and MonitoringNextPersistent storage

Last updated 1 month ago

For distributed setups, use the to configure and run Elastic stack on docker.

Elastic stack (ELK) on Docker