.. _info-logging-before-5-5: Solr Info Logging before 'Querqy for Solr' 5.5 ---------------------------------------------- .. warning:: This page contains information about how to set up info logging before 'Querqy for Solr' version **5.5.lucene900.0**. Documentation for newer Querqy versions can be found :ref:`here `. Querqy rewriters can return logging information together with the request response or send this information to other receivers. Currently only the common rules rewriter emits this information and it can be returned together with the Solr response. Configuration: **Querqy 5** .. code-block:: xml responseSink querqy.solr.ResponseSink common1 responseSink common2 responseSink Mappings can be configured before the rewriter is created. For example, in the above configuration, we have a mapping from rewriter 'common1' to sink 'responseSink'. This will be ignored if rewriter 'common1' doesn't exist, but logging will start as soon as you create a rewriter for the name 'common1'. **Querqy 4** .. code-block:: xml common1 querqy.solr.SimpleCommonRulesRewriterFactory rules1.txt common2 querqy.solr.SimpleCommonRulesRewriterFactory rules2.txt responseSink querqy.solr.ResponseSink common1 responseSink common2 responseSink The logging output must be enabled per request, using the request parameter querqy.infoLogging: ``querqy.infoLogging=on`` (default: off) This will add a section 'querqy.infoLog' to the Solr response: .. code-block:: xml (message for rule 1.1) (message for rule 1.2) (message for rule 2.1) (message for rule 2.2) Each rewriter can emit a list of log objects. In this case CommonRulesRewriter 'common1' emitted just a single log object (lst), which holds an array APPLIED_RULES that contains a log message for each rule that the rewriter has applied ((message for rule 1.1) etc). The log message can be defined in rules.txt using the ``_log`` property: .. code-block:: text notebook => SYNONYM: laptop DELETE: cheap @_id: "ID1" @_log: "Log message for notebook" samusng => SYNONYM: samsung @{ "_id": "ID2", "_log": "Log message for samusng typo", } 32g => SYNONYM: 32gb @_id: "ID3" The query 'samusng notebook 32g' will now produce the following log output: .. code-block:: xml Log message for notebook Log message for samusng typo ID3 As the third rule doesn't have a '_log' property, the ``_id`` property will be used as the message. If both, the '_log' and the '_id' property are missing, a default message will be created based on the input expression of the rule and a rule counter (samusng#1, 32g#2 etc.) Custom info logging sinks can be created by implementing the ``querqy.infologging.Sink`` interface.