配置日志过滤器

improve this page | report issue


概述

管理员可以从 MobileFirst Operations Console → [您的应用程序] → [版本] → 日志过滤器控制 MobileFirst 客户机 SDK 日志捕获和级别。
通过日志过滤器,您可以创建可以记录的过滤器级别。 可以全局(所有记录器实例)或针对特定的一个或多个包设置日志级别。

创建日志过滤器

为便于应用程序访存服务器上设置的配置覆盖,必须从定期运行的代码中某一位置调用 updateConfigFromServer 方法,例如,在应用程序生命周期回调中。

Android

Logger.updateConfigFromServer();

iOS

[OCLogger updateConfigFromServer];

Cordova

WL.Logger.updateConfigFromServer();

Web

ibmmfpfanalytics.logger.updateConfigFromServer();

服务器返回的 Logger 配置值优先于在客户机端设置的任何值。 当已除去客户机日志概要文件并且客户机尝试检索客户机日志概要文件时,客户机将收到空有效内容。 在这种情况下,Logger 配置缺省为最初在客户机上配置的内容。

转发服务器日志

MobileFirst Operations Console 还使服务器管理员能够持久存储日志并将这些日志发送至 MobileFirst Analytics Console。

要转发服务器日志,请浏览至运行时设置屏幕,并在其他包下指定记录器包。
然后,可以在 Analytics Console 中查看收集的日志。 如果用户要在无须收集所有服务器日志的情况下在 Analytics Console 中利用分类适配器日志,这将很有用。

Inclusive terminology note: The Mobile First Platform team is making changes to support the IBM® initiative to replace racially biased and other discriminatory language in our code and content with more inclusive language. While IBM values the use of inclusive language, terms that are outside of IBM's direct influence are sometimes required for the sake of maintaining user understanding. As other industry leaders join IBM in embracing the use of inclusive language, IBM will continue to update the documentation to reflect those changes.
Last modified on June 01, 2020