Skip to content

NIMMSTA Log/Error Reporting

Overview

This document provides guidance for developers on how to use ConnectionManager functions to disable and enable sentry log/ error reporting in an application. The focus is on two specific functions: disableLogReporting() and enableLogReporting(). These functions are utilized to control the log/ error reporting mechanism, specifically interacting with Sentry, a popular error tracking and monitoring tool.

Note

All logs are recorded in NIMMSTA Sentry project, which is not accessible to the public. This document solely serves as a reference for developers to understand how to use the functions to disable and enable log/ error reporting.

Functions Description

disableLogReporting()

This function turns off log/ error reporting. When invoked, it will stop sending logs to the monitoring tool (in this case, Sentry).

Implementation:

NIMMSTAServiceConnection.connectionManager.disableLogReporting()
NIMMSTAServiceConnection.getConnectionManager().disableLogReporting();

Usage:

  • When to Use: Typically used when you want to stop logging information during certain operations, such as in a development environment, during specific user interactions, or when log/ error reporting is not desired (e.g., to enhance performance or reduce data usage).
  • How to Use: Simply call disableLogReporting() from the ConnectionManager whenever log/ error reporting needs to be stopped.

enableLogReporting()

This function is the counterpart to disableLogReporting. It re-enables the log/ error reporting feature, allowing logs to be sent back to Sentry.

Implementation:

NIMMSTAServiceConnection.connectionManager.enableLogReporting()
NIMMSTAServiceConnection.getConnectionManager().enableLogReporting();

Usage:

  • When to Use: Use this function when you need to resume log/ error reporting, such as moving from a development to a production environment, or after having performed operations where logging was temporarily suspended.
  • How to Use: Invoke enableLogReporting() from the ConnectionManager to start log/ error reporting again.

Best Practices

Environment Awareness: Be aware of the environment in which these functions are being used. Avoid disabling log/ error reporting in production unless absolutely necessary.

Conclusion

The disableLogReporting and enableLogReporting functions provide essential control over log/ error reporting in applications, particularly for managing interactions with Sentry. Proper use of these functions ensures efficient and effective log management, catering to different environments and requirements within the application lifecycle.