tencent cloud

Real User Monitoring

Product Introduction
Overview
Features
Use Cases
Purchase Guide
Billing Overview
Purchase Methods
Payment Overdue
Getting Started
Operation Guide
Application Connection
Data Overview
Page Performance
Performance Data Analysis
Exception Analysis
Page View
API Monitoring
Static Resource
Custom Speed Test
Custom Event
Application Management
Access Management
Alarm Policy
Connection Guide
Web Use Cases
Mini Program Use Cases
API Documentation
History
Introduction
API Category
Making API Requests
Console APIs
Business System and Project Information APIs
Custom Speed Test APIs
Custom Event APIs
API Monitoring APIs
Exception Analysis APIs
Page View APIs
Static Resource Monitoring APIs
Log APIs
Page Performance APIs
Data Types
Error Codes
FAQs
Product
Troubleshooting
Usage
Service Protocol
Privacy Policy
Data Processing And Security Agreement
RUM Service Level Agreement
Terminal Performance Monitoring Privacy Policy
Terminal Performance Monitoring Data Processing And Security Agreement

Log Reporting

PDF
Focus Mode
Font Size
Last updated: 2024-01-22 19:25:42
The log query and offline log features can be used normally only after logs are reported. This document describes how to report logs to RUM.

Prerequisites

Install and initialize the Aegis SDK in any method as detailed in Installation and Initialization.

Log Reporting

Pass in the following parameters to configure the SDK and report logs:
// `info` can report any string, number, array, and object, but it reports data only when the user opening the page is in the allowlist
aegis.info('test');
aegis.info('test', 123, ['a', 'b', 'c', 1], {a: '123'});

// You can also report a specified object and pass in the `ext` and `trace` parameters
// You must pass in the `msg` field in this case
aegis.info({
msg: 'test',
ext1: 'ext1',
ext2: 'ext2',
ext3: 'ext3',
trace: 'trace',
});

// Different from `info`, `infoAll` reports full data
aegis.infoAll({
msg: 'test',
ext1: 'ext1',
ext2: 'ext2',
ext3: 'ext3',
trace: 'trace',
});

// `error` indicates a JavaScript error log, whose full data will also be reported. Generally, it is used to actively get and report JavaScript exceptions
aegis.error({
msg: 'test',
ext1: 'ext1',
ext2: 'ext2',
ext3: 'ext3',
trace: 'trace',
});
aegis.error(new Error('Actively report an error'));

// The default log type of `aegis.report` is `report`, but currently you can pass in any log type
aegis.report({
msg: 'This is an Ajax error log',
level: Aegis.LogType.AJAX_ERROR,
ext1: 'ext1',
ext2: 'ext2',
ext3: 'ext3',
trace: 'trace',
});


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback