Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.
Комментарий: Published by Scroll Versions from space RED and version 6.10-11
Description

Принцип работы логирования:

  1. Программа проверяет глобальный уровень логирования относительно уровня логирования сообщения.
  2. Если глобальный уровень позволяет логировать данное сообщение, то проверяется уровень логирования конкретного логгера.
  3. Если уровень логгера позволяет логировать данное сообщение, то сообщение передаётся в систему логирования.
  4. Система логирования проверяет все активные бэкенды логирования на возможность вывода сообщения (применяет фильтры).
  5. Сообщение выводится во все бэкенды, для которых фильтрация прошла успешно. При этом происходит форматирование сообщения для каждого бэкенда отдельно согласно его правилу форматирования.

Фильтрация сообщений на этапе 1 и 2 работает практически моментально. Фильтрация на этапе 4 работает на порядок медленнее, соответственно рекомендуется применять фильтрацию только тогда, когда это действительно необходимо.

Конфигурация логирования:

Sv translation
languageru

The basic idea of logging:

  1. The program checks the global logging level with regard to the logging level of a message.
  2. If the global logging level enables logging the message, the logging level of a specific logger is checked.
  3. If the logging level of the logger enables logging the message, the message is sent to the logging system.
  4. The logging system checks all active backends whether they are capable of the message output (applies filters).
  5. The message is sent to the backends for which the result of filtering was a success. In this case, the message is formatted for every backend according to its formatting rule.

Message filtering during the 1 and 2 stages does not take time. Filtering during the stage 4 takes a way much more time. Therefore, it is recommended to apply filtering only if it is crucial.

Logging configuration:

Content
СодержимоеОписание
 "Logging": {
 
        "Loggers": {

Contains the list of loggers for the various program components, where the key is a logger name, the value is a logging level. Logger separation is performed for fine-tuning messages to be logged:

  • Cachets - logging settings for the cached trees loading/unloading subsystem
  • InfoCollector - logging settings for the system information gathering subsystem
  • Integrity - logging settings for the data integrity checking/maintenance subsystem
  • Scan - logging settings for the folder scanning subsystem
  • Sender 

  • Dreamcatcher 
  • ProcMan 
  • IslerTManager 
  • IslerController 
  • IslerDocument 
  • IslerConnector 
  • StatementCollector 
  • Connection 
  • Collector 
  • EventConverter 
  • Statistics 
  • Iscp 
  • Object 
  • pop3 
  • Script 
  • nrpc 
  • Om3 
  • POP3 Parser 
  • imap4 
  • Automate 
  • ListenArea_capstack 
  • ListenArea_icq 
  • ListenArea_smtp 
  • ListenArea_pcap 
  • DB - data base logger
  • Devour - building xmlpipe2 files for indexer
  • Indexer - operations with the configuration file of searchd daemon: indexing, indexes and daemon files management
  • Root - root logger, responsible for reading DB records, indexes creating, archiving, indexes deleting
  • Stat - statistical data messages (various operations runtime) 

Possible logging levels (Severity):

  • trace - detailed logging (including messages with the levels debug, info and higher)
  • debug - debugging information output, usually for error diagnostics and communication with developers/tech support.
  • info - information messages, could be disabled on the stable system
  • warning
  • error
  • fatal - most important messages leading to system crash and failure.

 

Информация
titleExample:
From two values the strictest is selected, e.g. if 

Содержит список логеров разных программных компонентов, где ключ - имя логгера, а значение - уровень логирования. Разделение на логгеры реализовано с целью тонкой настройки сообщений для логирования:

  • Cachets - настройка логирования подсистемы загрузки/выгрузки кэшированных деревьев
  • InfoCollector - настройка логирования подсистемы сбора информации о системе
  • Integrity - настройка логирования подсистемы проверки/обеспечения целостности данных
  • Scan - настройка логирования подсистемы сканирования папок
  • Timings - настройка логирования стадий обработки объектов в icap по времени

  • Sender

  • Dreamcatcher
  • ProcMan
  • IslerTManager
  • IslerController
  • IslerDocument
  • IslerConnector
  • StatementCollector
  • Connection
  • Collector
  • EventConverter
  • Statistics
  • Iscp
  • Object
  • pop3
  • Script
  • nrpc
  • Om3
  • POP3 Parser
  • imap4
  • Automate
  • ListenArea_capstack
  • ListenArea_icq
  • ListenArea_smtp
  • ListenArea_pcap
  • WorkerDB
  • DB - логгер базы данных
  • Devour - построение файлов xmlpipe2 для indexer'а  
  • Indexer - операции с конфигурационным файлом демона searchd: индексирование, управление файлами индексов и самим демоном
  • Root - корневой логгер, отвечающий за чтение из БД, создание индексов, архивирование, удаление индексов
  • Stat - сообщения со статистическими данными (время выполнения различных операций) 

Возможные значения уровней логирования (Severity):

  • trace - наиболее подробное логирование (включаются все сообщения с уровнями debug, info и выше)
  • debug - вывод отладочной информации, обычно для диагностики ошибок и общения с разработкой/поддержкой
  • info - информационные сообщения, могут быть отключены на стабильной системе
  • warning - предупреждения.
  • error - ошибки.
  • fatal - наиболее важные сообщения, приводящие к завершению работы или отказу.
Информация
titleПример:

Из двух значений выбирается самое "строгое", т.е. если GlobalLevel = warning,  Stat = info

 

=>

effective value for 

эффективное значение для Stat = warning (

restricted by the global level

ограничено глобальным уровнем)

   


            "Root": "debug"
Root logger, responsible for reading DB records, indexes creating, archiving, indexes deleting
Корневой логер, отвечающий за чтение из БД, создание индексов, архивирование, удаление индексов
        }, 
 
      
        "Core": {
Logging kernel general settings   
Общие настройки ядра логирования.
            "DisableLogging": false
Capability to disable logging in the component. Disabling after the first 3 stages of the message transfer through the logging system, since these stages are performed outside of the logging system and are not controlled by this setting
Возможность полного отключения логирования в компоненте. Отключение происходит после первых 3 этапов прохождения сообщения через систему логирования, т.к. эти этапы происходят "снаружи" системы логирования и не регулируются данной настройкой.
        }, 
 
        "Backends": {
Backends list
Список бэкендов
              
            "DefaultDirectory": "/var/log/infowatch/", 
Default directory for logging to a file
Директория по умолчанию для логов в файл.
            "ActiveBackends": [
Active backends list. The backends, that are on the list, are considered for logging
Список активных бэкендов. Для логирования рассматриваются только те бэкенды, которые есть в этом списке.
                "Console", 
Console output (if the process is not launched as daemon, otherwise logs will be saved to 
Вывод в консоль (если процесс запущен не как демон, иначе логи будут сохраняться в директорию  /dev/null )
. The fastest backend            
. Самый быстрый бэкенд.
                "Syslog", 
System log output 
Вывод в системный лог ( /var/log/messages ).
The slowest backend            
Самый медленный бэкенд.
                "File"
Specified text file output (directory for a file to be created is specified in the parameter DefaultDirectory). Relatively slow backend
Вывод в указанный текстовый файл (директория для создания файла указана в параметре DefaultDirectory ). Относительно медленный бэкенд.
            ], 
 
           
            "Descriptions": {
Possible backend descriptions list, where the key is a backend name, the value is a backend description object. This list only describes backends. To make a backend active, add it to the list ActiveBackends              
Список описаний возможных бэкендов, где ключ - имя бэкенда, а значение - объект, описывающий данный бэкенд. Этот список только описывает бэкенды. Чтобы включить бэкенд, его нужно добавить в список ActiveBackends.
                "Syslog": {
System log output description
Описание вывода в системный лог.
                    "Destination": "Syslog", 
Backend type
Тип бэкенда
                    "Asynchronous": false,
Asynchronous backend or not. The asynchronous mode implies the message will be recorded after the message is processed by the logging system (the message will be enqueued and sent to console/syslog/file at some time). This means, if the System hangs up immediately after the message is processed by the logging system, there is a high possibility that the message to never be logged. The pro of the asynchronous mode is faster message processing (the main code of the program spends less time processing messages). It makes sense to set true, when it is necessary to have intensive logging, and the program performance does not raise questions. Otherwise, false should be set. 
 
Является ли бэкенд асинхронным.
При асинхронном режиме работы фактическая запись сообщения в бэкенд будет произведена когда-то после обработки сообщения системой логирования (сообщение будет поставлено в очередь и когда-то потом выведено в консоль/syslog/файл). Это означает, что если сразу после обработки сообщения системой логирования программа зависнет, то есть очень большая вероятность, что сообщение в лог никогда не попадёт (его не успеют записать). Плюс асинхронности - более быстрая обработка сообщений (основной код программы тратит меньше времени на обработку сообщений). Имеет смысл выставлять в true только тогда, когда необходимо очень интенсивное логирование, и при этом надежность программы не вызывает вопросов. Во всех остальных случаях стоит ставить false.
                    "Format": "%LineID% (%ProcessID%:%ThreadID%) 
[%Severity%] : <%Channel%> %Message%"
Message formatting rules. Key words for formatting and filtering

Правила форматирования сообщения. Ключевые слова для форматирования и фильтрации:

  • Severity -
logging level
  • уровень логирования
  • LineID -
line in a code, where the message was called
  • cтрока в коде, где было вызвано данное сообщение
  • ProcessID - PID
  • ThreadID - TID
  • Channel -
logger name, through which the message was sent
  • имя логгера, через который было выведено данное сообщение
  • Message -
message text
  • текст сообщения
  • TimeStamp -
message generation time stamp               
  • время генерации сообщения
                }, 
 
                "Console": {
Console output description
Описание вывода в консоль
                    "AutoFlush": true, 
Screen output or awaiting in the buffer. The false parameter gives the same result as 
Выводится ли сообщение на экран сразу или ожидает в буфере. При значении параметра  false  эффект примерно такой же, как от параметра  Asynchronous=true  (
see above
см. выше)
.
                    "Destination": "Console", 
Backend type                       
Тип бэкенда
                    "Asynchronous": false, 
Asynchronous backend or not
Является ли бэкенд асинхронным.
                    "Format": "%LineID% %TimeStamp% (%ProcessID%:%ThreadID%) 
[%Severity%] : <%Channel%> %Message%"
Message formating rules
Правила форматирования сообщения.
                }, 
 
                      
                "File": {
Specified text file output description                     
Описание вывода в указанный текстовый файл.
                    "Format": "%LineID% %TimeStamp% (%ProcessID%:%ThreadID%) 
[%Severity%] : <%Channel%> %Message%", 
Message formating rules
Правила форматирования сообщения.
                    "Destination": "TextFile", 
Backend type
Тип бэкенда
                    "FileName": "adlibitum.log", 
File name, where log will be written in Setting rules are the same (but invertible
Название файла, куда будет писаться лог.
                    "AutoFlush": true, 
Screen output or awaiting in the buffer. The false parameter gives the same result as Asynchronous=true.
Выводится ли сообщение на экран сразу или ждёт своего часа в буфере. При значении false эффект примерно такой же как от параметра Asynchronous, выставленного в true. Правила выставления точно такие же (только инвертированые).
                    "Asynchronous": false, 
Asynchronous backend or not
Является ли бэкенд асинхронным.
                    "Append": true
Add message to an old file or create a new file at the program startup
Добавлять ли сообщения к старому файлу или сделать на его месте новый при старте программы.
                }
 
            }
 
        }, 
 
        "SuppressExceptions": false, 
Suppress exceptions in the logging mechanism or higher
Подавлять ли исключения в механизме логирования
        "GlobalLevel": "warning"
Global logging level. Recommended value when implementing – error. This level enables logging messages with the level error
Глобальный уровень логирования. Рекомендуемое значение при внедрении – error. Такая настройка позволит записывать в лог только сообщения уровня error и выше (fatal). 
Normal operation value and by default
Значение при штатной эксплуатации и по умолчанию - warning,
 i
 т.
e. only errors and warnings are written in logs. It is not recommended to use the trace value without special purpose
е. в логи записываются только предупреждения и ошибки. Не рекомендуется без особой необходимости использовать значение trace

 

 

Sv translation
languageen

The basic idea of logging:

  1. The program checks the global logging level with regard to the logging level of a message.
  2. If the global logging level enables logging the message, the logging level of a specific logger is checked.
  3. If the logging level of the logger enables logging the message, the message is sent to the logging system.
  4. The logging system checks all active backends whether they are capable of the message output (applies filters).
  5. The message is sent to the backends for which the result of filtering was a success. In this case, the message is formatted for every backend according to its formatting rule.

Message filtering during the 1 and 2 stages does not take time. Filtering during the stage 4 takes a way much more time. Therefore, it is recommended to apply filtering only if it is crucial.

Logging configuration:

ContentDescription
 "Logging": {
 
        "Loggers": {

Contains the list of loggers for the various program components, where the key is a logger name, the value is a logging level. Logger separation is performed for fine-tuning messages to be logged:

  • Cachets - logging settings for the cached trees loading/unloading subsystem
  • InfoCollector - logging settings for the system information gathering subsystem
  • Integrity - logging settings for the data integrity checking/maintenance subsystem
  • Scan - logging settings for the folder scanning subsystem
  • Sender 

  • Dreamcatcher 
  • ProcMan 
  • IslerTManager 
  • IslerController 
  • IslerDocument 
  • IslerConnector 
  • StatementCollector 
  • Connection 
  • Collector 
  • EventConverter 
  • Statistics 
  • Iscp 
  • Object 
  • pop3 
  • Script 
  • nrpc 
  • Om3 
  • POP3 Parser 
  • imap4 
  • Automate 
  • ListenArea_capstack 
  • ListenArea_icq 
  • ListenArea_smtp 
  • ListenArea_pcap 
  • DB - data base logger
  • Devour - building xmlpipe2 files for indexer
  • Indexer - operations with the configuration file of searchd daemon: indexing, indexes and daemon files management
  • Root - root logger, responsible for reading DB records, indexes creating, archiving, indexes deleting
  • Stat - statistical data messages (various operations runtime) 

Possible logging levels (Severity):

  • trace - detailed logging (including messages with the levels debug, info and higher)
  • debug - debugging information output, usually for error diagnostics and communication with developers/tech support.
  • info - information messages, could be disabled on the stable system
  • warning
  • error
  • fatal - most important messages leading to system crash and failure.

 

Информация
titleExample:

From two values the strictest is selected, e.g. if GlobalLevel = warning,  Stat = info => effective value for Stat = warning (restricted by the global level)


 "Root": "debug"
Root logger, responsible for reading DB records, indexes creating, archiving, indexes deleting
  }, 
 
  "Core": {
Logging kernel general settings
      "DisableLogging": false
Capability to disable logging in the component. Disabling after the first 3 stages of the message transfer through the logging system, since these stages are performed outside of the logging system and are not controlled by this setting
   }, 
 
   "Backends": {
Backends list
       "DefaultDirectory": "/var/log/infowatch/", 
Default directory for logging to a file
       "ActiveBackends": [
Active backends list. The backends, that are on the list, are considered for logging
            "Console", 
Console output (if the process is not launched as daemon, otherwise logs will be saved to /dev/null). The fastest backend
            "Syslog", 
System log output (/var/log/messages). The slowest backend
            "File"
Specified text file output (directory for a file to be created is specified in the parameter DefaultDirectory). Relatively slow backend
       ], 
 
       "Descriptions": {
Possible backend descriptions list, where the key is a backend name, the value is a backend description object. This list only describes backends. To make a backend active, add it to the list ActiveBackends
           "Syslog": {
System log output description
               "Destination": "Syslog", 
Backend type
               "Asynchronous": false,
Asynchronous backend or not. The asynchronous mode implies the message will be recorded after the message is processed by the logging system (the message will be enqueued and sent to console/syslog/file at some time). This means, if the System hangs up immediately after the message is processed by the logging system, there is a high possibility that the message to never be logged. The pro of the asynchronous mode is faster message processing (the main code of the program spends less time processing messages). It makes sense to set true, when it is necessary to have intensive logging, and the program performance does not raise questions. Otherwise, false should be set.
           "Format": "%LineID% (%ProcessID%:%ThreadID%) 
[%Severity%] : <%Channel%> %Message%"

Message formatting rules. Key words for formatting and filtering:

  • Severity - logging level
  • LineID - line in a code, where the message was called
  • ProcessID - PID
  • ThreadID - TID
  • Channel - logger name, through which the message was sent
  • Message - message text
  • TimeStamp - message generation time stamp
               "Console": {
Console output description
                    "AutoFlush": true, 
Screen output or awaiting in the buffer. The false parameter gives the same result as Asynchronous=true (see above)
                    "Destination": "Console", 
Backend type
                     "Asynchronous": false, 
Asynchronous backend or not
                     "Format": "%LineID% %TimeStamp% (%ProcessID%:%ThreadID%) 
[%Severity%] : <%Channel%> %Message%"
Message formating rules
                }, 
 
                "File": {
Specified text file output description
                     "Format": "%LineID% %TimeStamp% (%ProcessID%:%ThreadID%) 
[%Severity%] : <%Channel%> %Message%", 
Message formating rules
                     "Destination": "TextFile", 
Backend type
                     "FileName": "adlibitum.log", 
File name, where log will be written in
                    "AutoFlush": true, 
Screen output or awaiting in the buffer. The false parameter gives the same result as Asynchronous=true. Setting rules are the same (but invertible).
                    "Asynchronous": false, 
Asynchronous backend or not
                    "Append": true
Add message to an old file or create a new file at the program startup
                }
 
            }
 
        }, 
 
        "SuppressExceptions": false, 
Suppress exceptions in the logging mechanism
        "GlobalLevel": "warning"
Global logging level. Recommended value when implementing – error. This level enables logging messages with the level error or higher (fatal). 
Normal operation value and by default - warning, i.e. only errors and warnings are written in logs. It is not recommended to use the trace value without special purpose