MCPcopy Index your code
hub / github.com/Meituan-Dianping/Logan

github.com/Meituan-Dianping/Logan @1.2.12

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.2.12 ↗ · + Follow
2,528 symbols 7,146 edges 358 files 796 documented · 31%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Logan

license Release Version PRs Welcome Platform Support

Logan 是美团点评集团推出的大前端日志系统。名称是 Log 和 An 的组合,代表个体日志服务,同时也是金刚狼大叔的大名。

总览

Logan 开源的是一整套日志体系,包括日志的收集存储,上报分析以及可视化展示。我们提供了五个组件,包括端上日志收集存储 、iOS SDKAndroid SDKWeb SDK,后端日志存储分析 Server,日志分析平台 LoganSite。并且提供了一个 Flutter 插件Flutter 插件

整体架构

Logan

效果演示

日志筛选

Logan

日志详情

Logan

快速开始

iOS

环境要求

以下是可以稳定跑起来的iOS配置,系统和xcode版本略大于或小于下面的版本理论上也是可以跑起来的。


macOS: 10.15.8

Xcode: 11.2

Cocoapods: 1.8.4

iOS: >= 8.0

安装 SDK

在你的Xcode工程根目录新建Podfile文件,并在文件中添加如下配置

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '8.0'

target 'TargetName' do

pod 'Logan', '~> 1.2.5'

end

最后在项目根目录运行以下命令:

pod install 

iOS SDK 接入文档

iOS SDK

Android

NDK: r16b

CMake: >= 3.4.1

Jdk: 1.7 或 1.8(推荐)

Android SDK 接入文档

Android SDK

Web SDK

可在 Web 平台( H5 或 PC 环境)上运行的 Logan 组件,实现前端日志的本地存储与上报功能。

接入方式

下载 npm 包

npm install --save logan-web

或者

yarn add logan-web

简单上手

日志存储

import Logan from 'logan-web';
let logContent = 'Your log content';
let logType = 1;

Logan.log(logContent, logType);

日志上报

import Logan from 'logan-web';
const reportResult = await Logan.report({
    reportUrl: 'https://yourServerAddressToAcceptLogs',
    deviceId: 'LocalDeviceIdOrUnionId',
    fromDayString: '2019-11-06',
    toDayString: '2019-11-07'
});

Web SDK 接入文档

Web SDK

Server

Server 接入文档

Server

LoganSite

环境要求

Node: ^10.15.3
yarn: ^1.15.2 或 npm ^6.12.0

安装

本地运行

首先,clone仓库到本地。

在LoganSite根目录下创建文件.env.development,并在其中指定API_BASE_URL环境变量指向:

API_BASE_URL=http://location/to/your/server:port

然后执行以下命令:

$ cd $LOGAN_SITE
$ npm install
$ npm run start

$ cd $LOGAN_SITE
$ yarn
$ yarn start

构建

首先,clone仓库到本地。

将 LoganSite/src/common/api.js 中第四行

const BASE_URL = process.defineEnv.API_BASE_URL;

中 BASE_URL 指向的部分替换成后端服务部署的地址:

const BASE_URL = "http://location/to/your/server:port"

然后执行以下命令:

$ cd $LOGAN_SITE
$ npm install
$ npm run build

$ cd $LOGAN_SITE
$ yarn
$ yarn build

LoganSite 接入文档

LoganSite

最佳实践

在Logan面世之前,日志系统是相对分散的。

Before_Logan

不同业务团队各自记录自己的日志,分析问题时再分别收集不同业务团队的日志进行整合,不同团队日志实现方式不同,获取日志的时间周期也不同,使得问题排查效率缓慢。Logan的思路是所有端上日志集中处理,按照不同的type进行区分,分析问题时可以随意聚合,有效提高日志分析效率。

Logan核心体系由四大模块构成:

  • 日志输入

  • 日志存储

  • 后端系统

  • 前端系统

Logan_Process

新的日志分析流程如下:

Logan_Case

未来

未来我们会提供基于Logan大数据的数据平台,包含机器学习、疑难日志解决方案、大数据特征分析等高级功能。

最后,我们希望提供更加完整的一体化个案分析生态系统。

Logan_System

Module Open Source Processing Planning
iOS & macOS
Android
Web
Back End
Front End
Mini Programs

贡献

关于贡献PRs和issue的更多信息,请参考贡献指南

作者

客户端

Web端

服务端

贡献者列表

联系我们

添加美团小助手微信,会帮助拉入 Logan 微信技术交流群: MTDPtech、MTDPtech01、MTDPtech03

License

Logan项目采用MIT许可协议 - 详细内容请查看LICENSE

相关文章

美团点评移动端基础日志库 — Logan

Logan:美团点评的开源移动端基础日志库

美团开源 Logan Web:前端日志在 Web 端的实现

相关知识

Extension points exported contracts — how you extend this code

ContentHandler (Interface)
日志格式化接口,使用可自行实现各种日志类型的格式化操作 [8 implementers]
Logan/Server/src/main/java/com/meituan/logan/web/handler/ContentHandler.java
LoganProtocolHandler (Interface)
(no doc) [4 implementers]
Example/Logan-Android/logan/src/main/java/com/dianping/logan/LoganProtocolHandler.java
LogStringOb (Interface)
(no doc)
Logan/WebSDK/src/save-log.ts
IReportLog (Interface)
(no doc)
Example/Logan-NodeServer/app.ts
LoganLogFileService (Interface)
@since 2019-11-08 16:01 [3 implementers]
Logan/Server/src/main/java/com/meituan/logan/web/service/LoganLogFileService.java
SendLogCallback (Interface)
Create by luoheng on 2019-11-20. [1 implementers]
Example/Logan-Android/logan/src/main/java/com/dianping/logan/SendLogCallback.java
LogItem (Interface)
(no doc)
Logan/WebSDK/src/interface.ts
ILogItem (Interface)
(no doc)
Example/Logan-NodeServer/app.ts

Core symbols most depended-on inside this repo

P
called by 217
Logan/WebSDK/demo/js/logan-web.js
mbedtls_mpi_free
called by 176
Logan/mbedtls/library/bignum.c
mbedtls_mpi_init
called by 133
Logan/mbedtls/library/bignum.c
compareTo
called by 128
Logan/Server/src/main/java/com/meituan/logan/web/dto/LoganTaskDTO.java
mbedtls_ssl_send_alert_message
called by 118
Logan/mbedtls/library/ssl_tls.c
mbedtls_mpi_mul_mpi
called by 88
Logan/mbedtls/library/bignum.c
R
called by 75
Example/Logan-WebSDK/demo/js/test.js
mbedtls_asn1_get_tag
called by 72
Logan/mbedtls/library/asn1parse.c

Shape

Function 1,868
Method 443
Class 170
Interface 37
Enum 10

Languages

C56%
TypeScript21%
Java20%
C++3%

Modules by API surface

Logan/mbedtls/library/ssl_tls.c173 symbols
Logan/Clogan/cJSON.c92 symbols
Logan/mbedtls/library/bignum.c56 symbols
Logan/mbedtls/library/md_wrap.c55 symbols
Logan/WebSDK/src/lib/js-encrypt.js55 symbols
Logan/mbedtls/library/ecp.c53 symbols
Logan/mbedtls/library/cipher_wrap.c53 symbols
Logan/mbedtls/library/x509_crt.c42 symbols
Logan/mbedtls/library/ssl_srv.c40 symbols
Logan/mbedtls/library/ssl_cli.c38 symbols
Logan/mbedtls/library/pk_wrap.c32 symbols
Logan/WebSDK/demo/js/logan-web.js30 symbols

Datastores touched

(mysql)Database · 1 repos
loganDatabase · 1 repos

For agents

$ claude mcp add Logan \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page