From fff4dc00657185743c77946fb940ab9fe4aaaf0f Mon Sep 17 00:00:00 2001 From: Markus Kalkbrenner Date: Wed, 15 Jan 2025 17:53:54 +0100 Subject: [PATCH] prepared top error statistics --- .../search_api.index.search_api_solr_log.yml | 5 + .../views.view.search_api_solr_log.yml | 1573 ++++++++--------- .../search_api_solr_log.links.menu.yml | 1 + .../src/Logger/SolrLogger.php | 6 +- 4 files changed, 796 insertions(+), 789 deletions(-) diff --git a/modules/search_api_solr_log/config/install/search_api.index.search_api_solr_log.yml b/modules/search_api_solr_log/config/install/search_api.index.search_api_solr_log.yml index 08b83de6..0a0db824 100644 --- a/modules/search_api_solr_log/config/install/search_api.index.search_api_solr_log.yml +++ b/modules/search_api_solr_log/config/install/search_api.index.search_api_solr_log.yml @@ -86,6 +86,11 @@ field_settings: datasource_id: solr_document property_path: ts_X3b_en_message type: text + message_string: + label: 'Message String' + datasource_id: solr_document + property_path: ss_message + type: string referer: label: Referer datasource_id: solr_document diff --git a/modules/search_api_solr_log/config/install/views.view.search_api_solr_log.yml b/modules/search_api_solr_log/config/install/views.view.search_api_solr_log.yml index 366e12d7..e3747559 100644 --- a/modules/search_api_solr_log/config/install/views.view.search_api_solr_log.yml +++ b/modules/search_api_solr_log/config/install/views.view.search_api_solr_log.yml @@ -78,125 +78,16 @@ display: use_highlighting: false multi_type: separator multi_separator: ', ' - pager: - type: none - options: - offset: 0 - exposed_form: - type: basic - options: - submit_button: Filter - reset_button: true - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: false - sort_asc_label: Asc - sort_desc_label: Desc - access: - type: perm - options: - perm: 'access site reports' - cache: - type: search_api_none - options: { } - empty: { } - sorts: { } - arguments: { } - filters: - index_id: - id: index_id - table: search_api_index_search_api_solr_log - field: index_id - relationship: none - group_type: group - admin_label: '' - plugin_id: search_api_string - operator: '=' - value: - min: '' - max: '' - value: search_api_solr_log - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - min_placeholder: '' - max_placeholder: '' - placeholder: '' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - filter_groups: - operator: AND - groups: - 1: AND - style: - type: default - options: - grouping: { } - row_class: '' - default_row_class: true - row: - type: fields - query: - type: search_api_query - options: - bypass_access: true - skip_access: true - preserve_facet_query_args: false - query_tags: { } - relationships: { } - header: { } - footer: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_interface' - - url - - user.permissions - tags: - - 'config:search_api.index.search_api_solr_log' - - 'search_api_list:search_api_solr_log' - event_details: - id: event_details - display_title: 'Event Details' - display_plugin: page - position: 1 - display_options: - title: 'Event Details' - fields: - id: - id: id + severity: + id: severity table: search_api_index_search_api_solr_log - field: id + field: severity relationship: none group_type: group admin_label: '' - plugin_id: search_api - label: Id - exclude: true + plugin_id: search_api_numeric + label: Severity + exclude: false alter: alter_text: false text: '' @@ -236,10 +127,19 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true + set_precision: false + precision: 0 + decimal: . + separator: '' + format_plural: false + format_plural_string: !!binary MQNAY291bnQ= + prefix: '' + suffix: '' link_to_item: false use_highlighting: false multi_type: separator multi_separator: ', ' + format_plural_values: { } type: id: type table: search_api_index_search_api_solr_log @@ -349,16 +249,16 @@ display: use_highlighting: false multi_type: separator multi_separator: ', ' - uid: - id: uid + variables: + id: variables table: search_api_index_search_api_solr_log - field: uid + field: variables relationship: none group_type: group admin_label: '' - plugin_id: search_api_numeric - label: User - exclude: false + plugin_id: search_api + label: Variables + exclude: true alter: alter_text: false text: '' @@ -398,87 +298,25 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - set_precision: false - precision: 0 - decimal: . - separator: '' - format_plural: false - format_plural_string: !!binary Aw== - prefix: '' - suffix: '' - link_to_item: false - use_highlighting: false - multi_type: separator - multi_separator: ', ' - format_plural_values: { } - location: - id: location - table: search_api_index_search_api_solr_log - field: location - relationship: none - group_type: group - admin_label: '' - plugin_id: search_api - label: Location - exclude: false - alter: - alter_text: false - text: '' - make_link: true - path: '{{ location }}' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true link_to_item: false use_highlighting: false multi_type: separator multi_separator: ', ' - referer: - id: referer + message: + id: message table: search_api_index_search_api_solr_log - field: referer + field: message relationship: none group_type: group admin_label: '' plugin_id: search_api - label: Referer + label: Message exclude: false alter: - alter_text: false - text: '' + alter_text: true + text: '{{ message | raw }}' make_link: true - path: '{{ referer }}' + path: 'admin/reports/search-api-solr-log/event?solr_id={{ id }}' absolute: false external: false replace_spaces: false @@ -491,16 +329,16 @@ display: suffix: '' target: '' nl2br: false - max_length: 0 + max_length: 56 word_boundary: true ellipsis: true more_link: false more_link_text: '' more_link_path: '' - strip_tags: false - trim: false + strip_tags: true + trim: true preserve_tags: '' - html: false + html: true element_type: '' element_class: '' element_label_type: '' @@ -517,19 +355,20 @@ display: use_highlighting: false multi_type: separator multi_separator: ', ' - severity: - id: severity + replace_variables: 1 + uid: + id: uid table: search_api_index_search_api_solr_log - field: severity + field: uid relationship: none group_type: group admin_label: '' plugin_id: search_api_numeric - label: Severity + label: User exclude: false alter: - alter_text: false - text: '' + alter_text: true + text: '{{ uid | raw}}' make_link: false path: '' absolute: false @@ -571,7 +410,7 @@ display: decimal: . separator: '' format_plural: false - format_plural_string: !!binary MQNAY291bnQ= + format_plural_string: !!binary Aw== prefix: '' suffix: '' link_to_item: false @@ -579,15 +418,15 @@ display: multi_type: separator multi_separator: ', ' format_plural_values: { } - hostname: - id: hostname + tags: + id: tags table: search_api_index_search_api_solr_log - field: hostname + field: tags relationship: none group_type: group admin_label: '' plugin_id: search_api - label: Hostname + label: Tags exclude: false alter: alter_text: false @@ -632,72 +471,523 @@ display: use_highlighting: false multi_type: separator multi_separator: ', ' - variables: - id: variables - table: search_api_index_search_api_solr_log - field: variables - relationship: none - group_type: group - admin_label: '' - plugin_id: search_api - label: Variables - exclude: true - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - link_to_item: false - use_highlighting: false - multi_type: separator - multi_separator: ', ' - message: - id: message + pager: + type: full + options: + offset: 0 + pagination_heading_level: h4 + items_per_page: 50 + total_pages: null + id: 0 + tags: + next: 'Next ›' + previous: '‹ Previous' + first: '« First' + last: 'Last »' + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + quantity: 9 + exposed_form: + type: basic + options: + submit_button: Filter + reset_button: true + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: false + sort_asc_label: Asc + sort_desc_label: Desc + access: + type: perm + options: + perm: 'access site reports' + cache: + type: search_api_none + options: { } + empty: { } + sorts: { } + arguments: { } + filters: + index_id: + id: index_id + table: search_api_index_search_api_solr_log + field: index_id + relationship: none + group_type: group + admin_label: '' + plugin_id: search_api_string + operator: '=' + value: + min: '' + max: '' + value: search_api_solr_log + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + min_placeholder: '' + max_placeholder: '' + placeholder: '' + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + facets_type: + id: facets_type + table: search_api_index_search_api_solr_log + field: facets_type + relationship: none + group_type: group + admin_label: '' + plugin_id: facets_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: '' + label: Type + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: type + required: false + remember: false + multiple: true + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + hierarchy: false + label_display: visible + facet: + query_operator: or + min_count: 1 + show_numbers: true + processor_configs: { } + facets_severity: + id: facets_severity + table: search_api_index_search_api_solr_log + field: facets_severity + relationship: none + group_type: group + admin_label: '' + plugin_id: facets_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: '' + label: Severity + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: severity + required: false + remember: false + multiple: true + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + hierarchy: false + label_display: visible + facet: + query_operator: or + min_count: 1 + show_numbers: true + processor_configs: + replace: + weights: + post_query: 50 + settings: + replacements: "7|debug\r\n6|info\r\n5|notice\r\n4|warning\r\n3|error\r\n2|critical\r\n1|alert\r\n0|emergency\r\n" + raw_value_widget_order: + weights: + sort: 50 + settings: + sort: ASC + display_value_widget_order: + weights: + sort: 40 + settings: + sort: ASC + facets_tags: + id: facets_tags + table: search_api_index_search_api_solr_log + field: facets_tags + relationship: none + group_type: group + admin_label: '' + plugin_id: facets_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: '' + label: Tags + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: tags + required: false + remember: false + multiple: true + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + hierarchy: false + label_display: visible + facet: + query_operator: and + min_count: 1 + show_numbers: true + processor_configs: + raw_value_widget_order: + weights: + sort: 50 + settings: + sort: ASC + facets_hostname: + id: facets_hostname + table: search_api_index_search_api_solr_log + field: facets_hostname + relationship: none + group_type: group + admin_label: '' + plugin_id: facets_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: '' + label: Hostname + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: hostname + required: false + remember: false + multiple: true + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + hierarchy: false + label_display: visible + facet: + query_operator: or + min_count: 1 + show_numbers: true + processor_configs: + raw_value_widget_order: + weights: + sort: 50 + settings: + sort: ASC + facets_timestamp: + id: facets_timestamp + table: search_api_index_search_api_solr_log + field: facets_timestamp + relationship: none + group_type: group + admin_label: '' + plugin_id: facets_filter + operator: '=' + value: '' + group: 1 + exposed: true + expose: + operator_id: '' + label: Date + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: timestamp + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + hierarchy: true + label_display: visible + facet: + query_operator: or + min_count: 1 + show_numbers: true + processor_configs: + hierarchy_processor: + weights: + build: 100 + settings: { } + date_item: + weights: + build: 35 + settings: + date_display: actual_date + granularity: '2' + hierarchy: 1 + date_format: '' + hierarchy: date_items + expand_hierarchy: 0 + search_api_fulltext: + id: search_api_fulltext + table: search_api_index_search_api_solr_log + field: search_api_fulltext + relationship: none + group_type: group + admin_label: '' + plugin_id: search_api_fulltext + operator: and + value: '' + group: 1 + exposed: true + expose: + operator_id: search_api_fulltext_op + label: 'Fulltext search' + description: '' + use_operator: false + operator: search_api_fulltext_op + operator_limit_selection: false + operator_list: { } + identifier: search_api_fulltext + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + expose_fields: false + placeholder: '' + searched_fields_id: search_api_fulltext_searched_fields + value_maxlength: 128 + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + parse_mode: terms + min_length: null + fields: + - message_en + filter_groups: + operator: AND + groups: + 1: AND + style: + type: table + options: + grouping: { } + row_class: '' + default_row_class: true + columns: + id: id + type: type + timestamp: timestamp + uid: uid + severity: severity + variables: variables + message: message + default: timestamp + info: + id: + sortable: false + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + type: + sortable: true + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + timestamp: + sortable: true + default_sort_order: desc + align: '' + separator: '' + empty_column: false + responsive: '' + uid: + sortable: true + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + severity: + sortable: true + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + variables: + sortable: false + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + message: + sortable: false + default_sort_order: asc + align: '' + separator: '' + empty_column: false + responsive: '' + override: true + sticky: false + summary: '' + empty_table: false + caption: '' + description: '' + row: + type: fields + options: { } + query: + type: search_api_query + options: + bypass_access: true + skip_access: true + preserve_facet_query_args: false + query_tags: { } + relationships: { } + header: { } + footer: { } + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_interface' + - url + - url.query_args + - user.permissions + tags: + - 'config:search_api.index.search_api_solr_log' + - 'search_api_list:search_api_solr_log' + event_details: + id: event_details + display_title: 'Event Details' + display_plugin: page + position: 1 + display_options: + title: 'Event Details' + fields: + id: + id: id table: search_api_index_search_api_solr_log - field: message + field: id relationship: none group_type: group admin_label: '' plugin_id: search_api - label: Message - exclude: false + label: Id + exclude: true alter: - alter_text: true - text: '{{ message | raw }}' + alter_text: false + text: '' make_link: false path: '' absolute: false @@ -738,133 +1028,16 @@ display: use_highlighting: false multi_type: separator multi_separator: ', ' - replace_variables: 1 - arguments: - id: - id: id - table: search_api_index_search_api_solr_log - field: id - relationship: none - group_type: group - admin_label: '' - plugin_id: search_api - default_action: default - exception: - value: all - title_enable: false - title: All - title_enable: false - title: '' - default_argument_type: query_parameter - default_argument_options: - query_param: solr_id - fallback: '' - multiple: and - summary_options: { } - summary: - sort_order: asc - number_of_records: 0 - format: default_summary - specify_validation: false - validate: - type: none - fail: 'not found' - validate_options: { } - break_phrase: false - not: false - filters: - index_id: - id: index_id - table: search_api_index_search_api_solr_log - field: index_id - relationship: none - group_type: group - admin_label: '' - plugin_id: search_api_string - operator: '=' - value: - min: '' - max: '' - value: search_api_solr_log - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - min_placeholder: '' - max_placeholder: '' - placeholder: '' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - filter_groups: - operator: AND - groups: - 1: AND - defaults: - title: false - fields: false - arguments: false - filters: false - filter_groups: false - display_description: '' - display_extenders: { } - path: admin/reports/search-api-solr-log/event - menu: - type: none - title: 'Recent log messages (Solr)' - description: '' - weight: 0 - expanded: false - menu_name: admin - parent: system.admin_reports - context: '0' - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_interface' - - url - - user.permissions - tags: - - 'config:search_api.index.search_api_solr_log' - - 'search_api_list:search_api_solr_log' - overview: - id: overview - display_title: 'Recent Log Messages' - display_plugin: page - position: 0 - display_options: - fields: - id: - id: id + type: + id: type table: search_api_index_search_api_solr_log - field: id + field: type relationship: none group_type: group admin_label: '' plugin_id: search_api - label: Id - exclude: true + label: Type + exclude: false alter: alter_text: false text: '' @@ -908,15 +1081,15 @@ display: use_highlighting: false multi_type: separator multi_separator: ', ' - severity: - id: severity + timestamp: + id: timestamp table: search_api_index_search_api_solr_log - field: severity + field: timestamp relationship: none group_type: group admin_label: '' - plugin_id: search_api_numeric - label: Severity + plugin_id: search_api_date + label: Date exclude: false alter: alter_text: false @@ -957,28 +1130,22 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - set_precision: false - precision: 0 - decimal: . - separator: '' - format_plural: false - format_plural_string: !!binary MQNAY291bnQ= - prefix: '' - suffix: '' + date_format: short + custom_date_format: '' + timezone: '' link_to_item: false use_highlighting: false multi_type: separator multi_separator: ', ' - format_plural_values: { } - type: - id: type + uid: + id: uid table: search_api_index_search_api_solr_log - field: type + field: uid relationship: none group_type: group admin_label: '' - plugin_id: search_api - label: Type + plugin_id: search_api_numeric + label: User exclude: false alter: alter_text: false @@ -1019,25 +1186,34 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true + set_precision: false + precision: 0 + decimal: . + separator: '' + format_plural: false + format_plural_string: !!binary Aw== + prefix: '' + suffix: '' link_to_item: false use_highlighting: false multi_type: separator multi_separator: ', ' - timestamp: - id: timestamp + format_plural_values: { } + location: + id: location table: search_api_index_search_api_solr_log - field: timestamp + field: location relationship: none group_type: group admin_label: '' - plugin_id: search_api_date - label: Date + plugin_id: search_api + label: Location exclude: false alter: alter_text: false text: '' - make_link: false - path: '' + make_link: true + path: '{{ location }}' absolute: false external: false replace_spaces: false @@ -1072,28 +1248,25 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - date_format: short - custom_date_format: '' - timezone: '' link_to_item: false use_highlighting: false multi_type: separator multi_separator: ', ' - variables: - id: variables + referer: + id: referer table: search_api_index_search_api_solr_log - field: variables + field: referer relationship: none group_type: group admin_label: '' plugin_id: search_api - label: Variables - exclude: true + label: Referer + exclude: false alter: alter_text: false text: '' - make_link: false - path: '' + make_link: true + path: '{{ referer }}' absolute: false external: false replace_spaces: false @@ -1132,21 +1305,21 @@ display: use_highlighting: false multi_type: separator multi_separator: ', ' - message: - id: message + severity: + id: severity table: search_api_index_search_api_solr_log - field: message + field: severity relationship: none group_type: group admin_label: '' - plugin_id: search_api - label: Message + plugin_id: search_api_numeric + label: Severity exclude: false alter: - alter_text: true - text: '{{ message | raw }}' - make_link: true - path: 'admin/reports/search-api-solr-log/event?solr_id={{ id }}' + alter_text: false + text: '' + make_link: false + path: '' absolute: false external: false replace_spaces: false @@ -1159,16 +1332,16 @@ display: suffix: '' target: '' nl2br: false - max_length: 56 + max_length: 0 word_boundary: true ellipsis: true more_link: false more_link_text: '' more_link_path: '' - strip_tags: true - trim: true + strip_tags: false + trim: false preserve_tags: '' - html: true + html: false element_type: '' element_class: '' element_label_type: '' @@ -1181,24 +1354,32 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true + set_precision: false + precision: 0 + decimal: . + separator: '' + format_plural: false + format_plural_string: !!binary MQNAY291bnQ= + prefix: '' + suffix: '' link_to_item: false use_highlighting: false multi_type: separator multi_separator: ', ' - replace_variables: 1 - uid: - id: uid + format_plural_values: { } + hostname: + id: hostname table: search_api_index_search_api_solr_log - field: uid + field: hostname relationship: none group_type: group admin_label: '' - plugin_id: search_api_numeric - label: User + plugin_id: search_api + label: Hostname exclude: false alter: - alter_text: true - text: '{{ uid | raw}}' + alter_text: false + text: '' make_link: false path: '' absolute: false @@ -1235,29 +1416,20 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - set_precision: false - precision: 0 - decimal: . - separator: '' - format_plural: false - format_plural_string: !!binary Aw== - prefix: '' - suffix: '' link_to_item: false use_highlighting: false multi_type: separator multi_separator: ', ' - format_plural_values: { } - tags: - id: tags + variables: + id: variables table: search_api_index_search_api_solr_log - field: tags + field: variables relationship: none group_type: group admin_label: '' plugin_id: search_api - label: Tags - exclude: false + label: Variables + exclude: true alter: alter_text: false text: '' @@ -1301,357 +1473,126 @@ display: use_highlighting: false multi_type: separator multi_separator: ', ' - pager: - type: full - options: - offset: 0 - pagination_heading_level: h4 - items_per_page: 50 - total_pages: null - id: 0 - tags: - next: 'Next ›' - previous: '‹ Previous' - first: '« First' - last: 'Last »' - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - quantity: 9 - filters: - index_id: - id: index_id - table: search_api_index_search_api_solr_log - field: index_id - relationship: none - group_type: group - admin_label: '' - plugin_id: search_api_string - operator: '=' - value: - min: '' - max: '' - value: search_api_solr_log - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - min_placeholder: '' - max_placeholder: '' - placeholder: '' - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - facets_type: - id: facets_type - table: search_api_index_search_api_solr_log - field: facets_type - relationship: none - group_type: group - admin_label: '' - plugin_id: facets_filter - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: '' - label: Type - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: type - required: false - remember: false - multiple: true - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - hierarchy: false - label_display: visible - facet: - query_operator: or - min_count: 1 - show_numbers: true - processor_configs: { } - facets_severity: - id: facets_severity - table: search_api_index_search_api_solr_log - field: facets_severity - relationship: none - group_type: group - admin_label: '' - plugin_id: facets_filter - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: '' - label: Severity - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: severity - required: false - remember: false - multiple: true - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - hierarchy: false - label_display: visible - facet: - query_operator: or - min_count: 1 - show_numbers: true - processor_configs: - display_value_widget_order: - weights: - sort: 40 - settings: - sort: ASC - facets_tags: - id: facets_tags + message: + id: message table: search_api_index_search_api_solr_log - field: facets_tags + field: message relationship: none group_type: group admin_label: '' - plugin_id: facets_filter - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: '' - label: Tags - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: tags - required: false - remember: false - multiple: true - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - hierarchy: false - label_display: visible - facet: - query_operator: and - min_count: 1 - show_numbers: true - processor_configs: - raw_value_widget_order: - weights: - sort: 50 - settings: - sort: ASC - facets_hostname: - id: facets_hostname + plugin_id: search_api + label: Message + exclude: false + alter: + alter_text: true + text: '{{ message | raw }}' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + link_to_item: false + use_highlighting: false + multi_type: separator + multi_separator: ', ' + replace_variables: 1 + arguments: + id: + id: id table: search_api_index_search_api_solr_log - field: facets_hostname + field: id relationship: none group_type: group admin_label: '' - plugin_id: facets_filter - operator: '=' - value: '' - group: 1 - exposed: true - expose: - operator_id: '' - label: Hostname - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: hostname - required: false - remember: false - multiple: true - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - hierarchy: false - label_display: visible - facet: - query_operator: or - min_count: 1 - show_numbers: true - processor_configs: - raw_value_widget_order: - weights: - sort: 50 - settings: - sort: ASC - facets_timestamp: - id: facets_timestamp + plugin_id: search_api + default_action: default + exception: + value: all + title_enable: false + title: All + title_enable: false + title: '' + default_argument_type: query_parameter + default_argument_options: + query_param: solr_id + fallback: '' + multiple: and + summary_options: { } + summary: + sort_order: asc + number_of_records: 0 + format: default_summary + specify_validation: false + validate: + type: none + fail: 'not found' + validate_options: { } + break_phrase: false + not: false + filters: + index_id: + id: index_id table: search_api_index_search_api_solr_log - field: facets_timestamp + field: index_id relationship: none group_type: group admin_label: '' - plugin_id: facets_filter + plugin_id: search_api_string operator: '=' - value: '' + value: + min: '' + max: '' + value: search_api_solr_log group: 1 - exposed: true + exposed: false expose: operator_id: '' - label: Date + label: '' description: '' use_operator: false operator: '' operator_limit_selection: false operator_list: { } - identifier: timestamp - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - hierarchy: true - label_display: visible - facet: - query_operator: or - min_count: 1 - show_numbers: true - processor_configs: - hierarchy_processor: - weights: - build: 100 - settings: { } - date_item: - weights: - build: 35 - settings: - date_display: actual_date - granularity: '2' - hierarchy: 1 - date_format: '' - hierarchy: date_items - expand_hierarchy: 0 - search_api_fulltext: - id: search_api_fulltext - table: search_api_index_search_api_solr_log - field: search_api_fulltext - relationship: none - group_type: group - admin_label: '' - plugin_id: search_api_fulltext - operator: and - value: '' - group: 1 - exposed: true - expose: - operator_id: search_api_fulltext_op - label: 'Fulltext search' - description: '' - use_operator: false - operator: search_api_fulltext_op - operator_limit_selection: false - operator_list: { } - identifier: search_api_fulltext required: false remember: false multiple: false remember_roles: authenticated: authenticated - expose_fields: false + min_placeholder: '' + max_placeholder: '' placeholder: '' - searched_fields_id: search_api_fulltext_searched_fields - value_maxlength: 128 is_grouped: false group_info: label: '' @@ -1664,14 +1605,66 @@ display: default_group: All default_group_multiple: { } group_items: { } - parse_mode: terms - min_length: null - fields: - - message_en filter_groups: operator: AND groups: 1: AND + defaults: + title: false + fields: false + arguments: false + filters: false + filter_groups: false + display_description: '' + display_extenders: { } + path: admin/reports/search-api-solr-log/event + menu: + type: none + title: 'Recent log messages (Solr)' + description: '' + weight: 0 + expanded: false + menu_name: admin + parent: system.admin_reports + context: '0' + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_interface' + - url + - url.query_args + - user.permissions + tags: + - 'config:search_api.index.search_api_solr_log' + - 'search_api_list:search_api_solr_log' + overview: + id: overview + display_title: 'Recent Log Messages' + display_plugin: page + position: 0 + display_options: + pager: + type: full + options: + offset: 0 + pagination_heading_level: h4 + items_per_page: 50 + total_pages: null + id: 0 + tags: + next: 'Next ›' + previous: '‹ Previous' + first: '« First' + last: 'Last »' + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + quantity: 9 style: type: table options: @@ -1750,17 +1743,21 @@ display: pager: false style: false row: false - fields: false - filters: false - filter_groups: false + fields: true + filters: true + filter_groups: true display_description: '' display_extenders: { } path: admin/reports/search-api-solr-log menu: type: normal title: 'Recent log messages (Solr)' + description: 'View events that have recently been logged.' + weight: -1 + expanded: false menu_name: admin parent: system.admin_reports + context: '0' cache_metadata: max-age: -1 contexts: diff --git a/modules/search_api_solr_log/search_api_solr_log.links.menu.yml b/modules/search_api_solr_log/search_api_solr_log.links.menu.yml index 28e5737b..bd598c0d 100644 --- a/modules/search_api_solr_log/search_api_solr_log.links.menu.yml +++ b/modules/search_api_solr_log/search_api_solr_log.links.menu.yml @@ -1,5 +1,6 @@ search_api_solr_log.settings: title: 'Solr Log settings' + description: 'Configure logging details.' parent: system.admin_config_search route_name: search_api_solr_log.settings diff --git a/modules/search_api_solr_log/src/Logger/SolrLogger.php b/modules/search_api_solr_log/src/Logger/SolrLogger.php index 7752c151..fbb4acf9 100644 --- a/modules/search_api_solr_log/src/Logger/SolrLogger.php +++ b/modules/search_api_solr_log/src/Logger/SolrLogger.php @@ -34,6 +34,7 @@ class SolrLogger implements LoggerInterface { 'message' => 'tus_message', 'variables' => 'zs_variables', 'message_en' => 'ts_X3b_en_message', + 'message_facet' => 'ss_message', 'severity' => 'its_severity', 'link' => 'ss_link', 'location' => 'ss_location', @@ -87,6 +88,8 @@ public function log($level, string|\Stringable $message, array $context = []): v // style, so they can be translated too in runtime. $message_placeholders = $this->parser->parseMessagePlaceholders($message, $context); $channel = mb_substr($context['channel'], 0, 64); + $message_en = $this->t(Xss::filterAdmin((string) $message), (array) $message_placeholders)->render(); + $message_facet = mb_substr($message_en, 0, 255); $values = [ 'id' => 'search_api_solr_log:' . $channel . ':' . uniqid(), static::$logFieldMappings['site_hash'] => Utility::getSiteHash(), @@ -96,7 +99,8 @@ public function log($level, string|\Stringable $message, array $context = []): v static::$logFieldMappings['type'] => $channel, static::$logFieldMappings['message'] => (string) $message, static::$logFieldMappings['variables'] => json_encode($message_placeholders, JSON_PRETTY_PRINT), - static::$logFieldMappings['message_en'] => $this->t(Xss::filterAdmin((string) $message), (array) $message_placeholders)->render(), + static::$logFieldMappings['message_en'] => $message_en, + static::$logFieldMappings['message_facet'] => $message_facet, static::$logFieldMappings['severity'] => $level, static::$logFieldMappings['link'] => $context['link'], static::$logFieldMappings['location'] => $context['request_uri'],