Ejemplo n.º 1
0
func (e *GenericLogEvent) Suppress(settings_ settings.SettingsInterface) bool {
	for _, name := range settings_.GetGenericSuppressNames() {
		if e.Name == name {
			return true
		}
	}

	return false
}
Ejemplo n.º 2
0
func (e *NginxAccessLogEvent) Suppress(
	settings_ settings.SettingsInterface,
) bool {
	for _, statusCode := range settings_.GetNginxSuppressStatusCodes() {
		if e.Request.StatusCode == statusCode {
			return true
		}
	}

	return false
}
Ejemplo n.º 3
0
func (e *ProcessLogEvent) Suppress(settings_ settings.SettingsInterface) bool {
	for _, name := range settings_.GetProcessSuppressNames() {
		if e.Name == name {
			return true
		}
		matched, _ := regexp.MatchString(name, e.Name)
		if matched {
			return true
		}
	}

	return false
}
Ejemplo n.º 4
0
func (e *BigcommerceAppLogEvent) Suppress(
	settings_ settings.SettingsInterface,
) bool {
	suppressedLevels := settings_.GetBigcommerceAppSuppressLogLevels()

	for _, logLevel := range suppressedLevels {
		if e.LogLevel == logLevel {
			return true
		}
	}

	return false
}
Ejemplo n.º 5
0
func (e *PhpLogEvent) Suppress(settings_ settings.SettingsInterface) bool {
	contentPatterns := settings_.GetPhpSuppressContentRegexes()

	for _, pattern := range contentPatterns {
		matched, err := regexp.MatchString(pattern, e.Content)

		if err != nil {
			log.Fatalf(
				"Error while matching ignore filters: %s (%s)\n",
				pattern,
				err,
			)
		}

		if matched {
			return true
		}
	}

	return false
}
Ejemplo n.º 6
0
func (e *PhpStackTraceLogEvent) Suppress(
	settings_ settings.SettingsInterface,
) bool {
	return settings_.GetPhpSuppressStackTraces()
}