Skip to main content
Version: Next

RealtimeLogManager

The real-time log manager instance, which can be obtained via Taro.getRealtimeLogManager.

How to Use

To help mini program developers quickly troubleshoot mini program vulnerabilities and locate problems, we have introduced a real-time logging feature. Starting from Foundation 2.7.1, developers can print logs through the interface provided, and the logs will be aggregated and reported to the mini program backend in real time.

Developers can access the log query page on the mini program side from "Development->Operation and Maintenance Centre->Real-time Log" in the mini program management backend, or from "mini program Plug-in->Real-time Log" to view the log information printed by developers.

Methods

addFilterMsg

Add filter keywords.

Reference

(msg: string) => void
PropertyTypeDescription
msgstringParameter to setFilterMsg, used to set multiple filter keywords.

API Support

APIWeChat Mini-ProgramH5React Native
RealtimeLogManager.addFilterMsg✔️

error

Writes the "error" log.

Reference

(...args: any[]) => void
PropertyTypeDescription
argsany[]The log can contain any number of entries, but the total size of the parameters of a single call cannot exceed 5 KB.

API Support

APIWeChat Mini-ProgramH5React Native
RealtimeLogManager.error✔️

in

Set the page where the live log page parameter is located

Reference

(pageInstance: any) => void
PropertyType
pageInstancepage instance

API Support

APIWeChat Mini-ProgramH5React Native
RealtimeLogManager.in✔️

info

Writes the "info" log.

Reference

(...args: any[]) => void
PropertyTypeDescription
argsany[]The log can contain any number of entries, but the total size of the parameters of a single call cannot exceed 5 KB.

API Support

APIWeChat Mini-ProgramH5React Native
RealtimeLogManager.info✔️

setFilterMsg

Set filter keywords

Reference

(msg: string) => void
PropertyTypeDescription
msgstringFilter keywords of no more than 1KB can be searched in the mini program administration backend to get the corresponding logs based on the content set.

API Support

APIWeChat Mini-ProgramH5React Native
RealtimeLogManager.setFilterMsg✔️

warn

Writes the "warn" log.

Reference

(...args: any[]) => void
PropertyTypeDescription
argsany[]The log can contain any number of entries, but the total size of the parameters of a single call cannot exceed 5 KB.

API Support

APIWeChat Mini-ProgramH5React Native
RealtimeLogManager.warn✔️

API Support

APIWeChat Mini-ProgramH5React Native
RealtimeLogManager.addFilterMsg✔️
RealtimeLogManager.error✔️
RealtimeLogManager.in✔️
RealtimeLogManager.info✔️
RealtimeLogManager.setFilterMsg✔️
RealtimeLogManager.warn✔️