Skip to main content
QUICK REVIEW

[Paper Review] Efficient Logging for Blockchain Applications

Christopher Klinkmüller, Ingo Weber|arXiv (Cornell University)|Jan 28, 2020
Software System Performance and ReliabilityComputer Science5 references5 citations
TL;DR

This paper introduces the Ethereum Logging Framework (ELF), a configurable open-source system that enables cost-efficient logging in Ethereum smart contracts and efficient extraction of blockchain data into standardized formats like CSV, XES, and text. ELF supports both static and real-time log analysis through declarative manifests, enabling developers to generate logging code and extract structured data without access to source code, demonstrated across three real-world case studies including network monitoring, prediction markets, and game analytics.

ABSTRACT

Second generation blockchain platforms, like Ethereum, can store arbitrary data and execute user-defined smart contracts. Due to the shared nature of blockchains, understanding the usage of blockchain-based applications and the underlying network is crucial. Although log analysis is a well-established means, data extraction from blockchain platforms can be highly inconvenient and slow, not least due to the absence of logging libraries. To close the gap, we here introduce the Ethereum Logging Framework (ELF) which is highly configurable and available as open source. ELF supports users (i) in generating cost-efficient logging code readily embeddable into smart contracts and (ii) in extracting log analysis data into common formats regardless of whether the code generation has been used during development. We provide an overview of and rationale for the framework's features, outline implementation details, and demonstrate ELF's versatility based on three case studies from the public Ethereum blockchain.

Motivation & Objective

  • To address the lack of dedicated logging libraries for Ethereum, which hinders effective monitoring and analysis of decentralized applications (dApps).
  • To enable developers to generate cost-efficient logging code directly embeddable into smart contracts, reducing gas overhead.
  • To provide a flexible, declarative framework for extracting and transforming blockchain data into standardized formats regardless of whether logging was used during development.
  • To support both batch and streaming log extraction for real-time monitoring and historical analysis on public and private Ethereum blockchains.
  • To demonstrate the framework’s versatility through real-world case studies involving network statistics, prediction markets, and dApp lifecycle tracking.

Proposed method

  • The framework uses a declarative manifest file to specify which Ethereum data to extract, how to transform it, and in which format to export it, abstracting low-level implementation details.
  • The manifest is validated syntactically and semantically using ANTLR4 and custom rules to ensure correctness before processing.
  • The extractor component uses Ethereum’s JSON-RPC API via Web3j to query nodes, retrieve data, apply transformations, and export to target formats such as CSV, text, or XES.
  • The generator component derives optimized logging code from the manifest, enabling developers to embed efficient logging directly into smart contracts.
  • The framework supports two modes: batch (one-time export of historical data) and streaming (continuous export per block, with potential overwrites in PoW chains due to reorgs).
  • The implementation is built in Java 13, leveraging OpenXES for XES export and standard libraries for CSV/text, ensuring compatibility and performance.

Experimental results

Research questions

  • RQ1How can developers efficiently instrument smart contracts with low-cost logging to support application monitoring and analysis on Ethereum?
  • RQ2What mechanisms enable the extraction of structured, analyzable data from Ethereum’s raw blockchain data without requiring access to smart contract source code?
  • RQ3How can a generic framework support diverse logging and analysis workloads across different types of dApps, including financial systems, games, and prediction markets?
  • RQ4What are the performance and scalability characteristics of a declarative, configuration-driven approach to blockchain log extraction compared to custom implementations?
  • RQ5To what extent can such a framework enable real-time monitoring and historical analysis of blockchain activity through batch and streaming modes?

Key findings

  • ELF enables the generation of cost-efficient logging code for smart contracts through a declarative manifest, reducing gas overhead and improving deployability.
  • The framework supports selective, configurable data extraction from Ethereum nodes into multiple standardized formats, including CSV, text, and XES, without requiring access to source code.
  • ELF’s streaming mode allows for near-real-time log analysis, though it may produce overwrites in proof-of-work chains due to block reorganizations.
  • The framework was successfully applied to three real-world case studies: monitoring Ethereum network statistics (14-line manifest), tracking contract register updates in the Augur prediction market (234-line manifest), and analyzing the lifecycle of CryptoKitties (60-line manifest).
  • In the CryptoKitties case, ELF enabled noise-free XES log extraction by filtering for cats born within a specific block range—something not feasible with prior tools like BloXES.
  • The framework’s design ensures technological independence, as it relies only on the standardized Ethereum JSON-RPC API, making it compatible with any compliant node client and blockchain network.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.