entaxy-public/platform/runtime/base/logging/entaxy-audit/Logging-config.md
2024-12-14 04:07:49 +03:00

48 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Настройка логгирования в entaxy
Нужен артефакт cef-logger-layout версии __1.0.1__.
Его требуется любым доступным способом задеплоить
в karaf/entaxy.
## Настройка лог-файла
В файл `<karaf-root>/etc/org.ops4j.pax.logging.cfg` необходимо добавить:
```
# CEF logger
log4j2.logger.AUDIT_FILE.name = AUDIT_LOGFILE
log4j2.logger.AUDIT_FILE.level = INFO
log4j2.logger.AUDIT_FILE.appenderRef.AUDIT_LOGFILE.ref = AuditCompositeLogger
log4j2.logger.AUDIT_FILE.additivity = false
log4j2.appender.AUDIT_LOGFILE.type = CEFAggregate
log4j2.appender.AUDIT_LOGFILE.name = AuditCompositeLogger
log4j2.appender.AUDIT_LOGFILE.children = CefFile
log4j2.appender.AUDIT_LOGFILE.filter.threshold.type = ThresholdFilter
log4j2.appender.AUDIT_LOGFILE.filter.threshold.level = INFO
log4j2.appender.AUDIT_LOGFILE_1.type = RollingRandomAccessFile
log4j2.appender.AUDIT_LOGFILE_1.name = CefFile
log4j2.appender.AUDIT_LOGFILE_1.append = true
log4j2.appender.AUDIT_LOGFILE_1.fileName = ${karaf.log}/cef-audit.log
log4j2.appender.AUDIT_LOGFILE_1.filePattern = ${karaf.log}/cef-audit-%d{MM-dd-yyyy}.log
log4j2.appender.AUDIT_LOGFILE_1.layout.type = CEFLayout
log4j2.appender.AUDIT_LOGFILE_1.layout.vendor = EMDEV
log4j2.appender.AUDIT_LOGFILE_1.layout.product = ENTAXY
log4j2.appender.AUDIT_LOGFILE_1.layout.productVersion = 1.1.10-SNAPSHOT
log4j2.appender.AUDIT_LOGFILE_1.policies.type = Policies
log4j2.appender.AUDIT_LOGFILE_1.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.AUDIT_LOGFILE_1.policies.size.size = 10MB
log4j2.appender.AUDIT_LOGFILE_1.filter.threshold.type = ThresholdFilter
log4j2.appender.AUDIT_LOGFILE_1.filter.threshold.level = INFO
```
Здесь используется композитный логгер, так что при необходимости
можно добавить вывод в консоль в cef или json формате
по образцу того, как было сделано в wso2.
Логгируется:
- Вход/выход в hawtio
- Все команды JAAS в karaf
- Изменения бандлов и конфигурации в karaf.