Add these to LoggerServiceBase with overrideMinLevelWhen() to override the minLevel rule, and include a log entry based on a variety of characteristics. Each instance must match all properties that are assigned. There are helpful tools, like regexp matching on strings and where you enter a string, not a regexp, it is a case insensitive match.

interface OverrideMinLevelWhenRule {
    message?: string | RegExp;
    level?: LoggingLevel;
    category?: LoggingCategory;
    type?: string | Function | RegExp;
    feature?: string | RegExp;
    identity?: string | RegExp;
    hasData?: boolean;
    data?: {
        [key: string]: any;
    };
}

Properties

message?: string | RegExp

If assigned, look at the message. As a string, it will be a case insensitive contained in the string. Using a regexp, you can match the entire string or use case sensitivity.

level?: LoggingLevel

If assigned, look at the level. It must be an exact match, not this level and all higher levels.

category?: LoggingCategory

If assigned, look at the category. It must be an exact match.

type?: string | Function | RegExp

If assigned, look at the type. As a string, it will be a case insensitive contained in the string. Using a regexp, you can match the entire string or use case sensitivity. It can also be the class Type, such as InputValueHost (the class itself, not a string).

feature?: string | RegExp

If assigned, look at the feature field. As a string, it will be a case insensitive contained in the string. Using a regexp, you can match the entire string or use case sensitivity.

identity?: string | RegExp

If assigned, look at the identity field. As a string, it will be a case insensitive contained in the string. Using a regexp, you can match the entire string or use case sensitivity.

hasData?: boolean

If assigned, look at the data field. When true, only return those with data property assigned. When false, omit those with data property assigned. undefined means ignore this filter.

data?: {
    [key: string]: any;
}

Assign to an object to match to the data. The object can have a subset of properties to match. The values must be exact matches. When assigned, hasData is ignored as the data property must be assigned.

Type declaration

  • [key: string]: any

Generated using TypeDoc v0.25.12