Console Logging

The console logging mechanism has some predefined filters for messages, like alerts, warnings, etc.

If there are a lot of messages with a similar pattern but still unique, the UIC will log all the messages.

Example:

Error creating the connection for X - will retry in 205

Error creating the connection - will retry in 320

The filters did not include an option to filter messages based on specific text or from a source. Example: A user may want to exclude error messages from getting logged.

From 12.2.4 onwards, the Console Logging has been enhanced so that the captureConsole configuration supports filtering console messages based on their content. The following code is an example for the configuration:
 captureConsole: {
            enabled: true,
            methods: [],
            excludeMessages: [
                {
                    type: 'log',
                    message: '<search-pattern>'
                },
                {
                    type: 'error',
                    regex: '.*User is not logged in.*',
                    flag: 'i'
                },
                {
                    regex: 'Boltics.*',
                    flag: 'i'
                }
            ]
        }, 
Console Logging now supports the following filters:
  • message – Excludes messages containing the specified text. Matching is case-insensitive.
  • regex – Excludes messages matching the specified regular expression.
  • flag – Supports regex flags such as i for case-insensitive matching.
  • type – Optional. Restricts the filter to a specific console method (log, warn, info, or error).
In the earlier provided configuration example:
  • Messages containing <search-pattern> are excluded only when logged using console.log(). And this is case insensitive. The system will exclude string that has <search-pattern>, <Search-Pattern>, and <SEARCH-PATTERN>.
  • Messages matching User is not logged in are excluded only when logged using console.error(). Case sensitivity depends on regular expression flag.
  • Messages matching Boltics.* are excluded from all console methods (log, warn, info, and error) since no type is specified.