Logan Web: An Open‑Source Front‑End Logging SDK and Its Technical Implementation

Logan Web is Meituan‑Dianping’s open‑source front‑end logging SDK that stores encrypted logs in IndexedDB, triggers batch uploads on exceptions or user actions, and integrates with server‑side services and a visual analysis platform to provide end‑to‑end traceability for massive web traffic.

Meituan Technology Team
Meituan Technology Team
Meituan Technology Team
Logan Web: An Open‑Source Front‑End Logging SDK and Its Technical Implementation

Logan is a large‑scale front‑end logging system launched by Meituan‑Dianping. After open‑sourcing Android and iOS SDKs in 2018, the project released a Web‑environment SDK, a log‑analysis platform, and server‑side code in December 2019, providing a complete solution for multi‑platform front‑end logging.

Background – Before Logan, developers often struggled to reproduce user‑reported issues because they lacked complete log streams and contextual information. Logan aims to store, collect, upload, and analyze logs from client, Web, and mini‑program environments, enabling rapid problem localization.

General Strategy – Logan adopts a local‑storage‑plus‑triggered‑upload model to avoid the high cost of real‑time uploading and the difficulty of finding useful logs in massive streams. Logs are first persisted locally; when an exception or user feedback is detected, a trigger uploads the relevant logs to the server for analysis.

Core Components

User‑side SDKs (client, Web, mini‑program) for log storage and upload.

Server‑side services for receiving, parsing, aggregating, and analyzing logs.

Log analysis platform that visualizes log data.

Challenges on the Web

How to store large volumes of logs locally.

How to ensure log security.

How to trigger reliable uploads.

Technical Implementation

Logan Web uses IndexedDB as the high‑capacity local storage container and applies a hybrid encryption scheme (AES‑128‑CTR + RSA‑1024) to protect privacy logs.

The SDK (logan‑web) consists of two main modules:

Storage module – encrypts logs, packages them, and writes them to IndexedDB with pagination.

Upload module – reads logs by day, uploads them in batches, and forwards them to the analysis platform.

Both modules rely on a shared Logan DB layer that manages storage capacity and pagination.

idb‑managed Package

To overcome IndexedDB limitations, Logan Web bundles the idb-managed library, which provides:

A DB Manager that records version and schema information, eliminating upgrade‑failure issues.

Data‑expiration indexes that automatically delete stale entries.

Transactional multi‑table atomic operations using IDBTransaction rollback.

Log Encryption

Each private log undergoes the following steps:

Generate a random AES key and IV.

Encrypt the log plaintext with AES‑CTR.

Encrypt the AES key with the server’s RSA public key.

Package IV, ciphertext, and encrypted key into a log object.

Upload Trigger Mechanisms

User‑initiated: DOM hooks on PC, shake detection on mobile, or UI sidebars.

Code‑initiated: Direct SDK upload calls or automatic triggers on exceptions.

Production Practice

Logan Web has been deployed inside Meituan, handling over 150 million daily page views and more than 500 daily log uploads. Integrated with the native app via a JS bridge, Web logs are merged with mobile client logs for end‑to‑end traceability.

Open‑Source Progress & Future

The Web SDK, server components, and analysis platform are all open‑sourced on GitHub (Meituan‑Dianping/Logan). The Web SDK supports TypeScript and configurable encryption strategies. Future work includes further optimization and expanding cross‑platform logging capabilities.

Contact

Contributions are welcomed via GitHub PRs/Issues or email ([email protected]). A technical WeChat group (ID: MTDPtech03) is also available for direct communication.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

open sourceIndexedDBHybrid Encryptionfront-end loggingLoganWeb SDK
Meituan Technology Team
Written by

Meituan Technology Team

Over 10,000 engineers powering China’s leading lifestyle services e‑commerce platform. Supporting hundreds of millions of consumers, millions of merchants across 2,000+ industries. This is the public channel for the tech teams behind Meituan, Dianping, Meituan Waimai, Meituan Select, and related services.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.