You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a check to see if the err argument is nil when its passed to Error()
Add a check to see if the err argument is nil before attempting to call .Error() on it. This avoids panic.
refactor: changes regarding indexing log entries in elasticsearch
Changes in logConsumer:
- Extract log ID from message and use as document id
- Skip messages with missing or invalid 'id' field
- Update Kafka and Zookeeper images in docker-compose.yaml
- Consume Kafka messages from oldest offset instead of newest
Logharbour package:
- Refactor LogEntry to use a structured LogData field
Introduced a new LogData struct as the type for Data field in LogEntry. Now change, activity and debug log data is stored in separate fields in LogData. This makes managing Elasticsearch index simple. Exposed methods for logging i.e. LogDataChange, LogActivity and LogDebug internally process data passed to them to create correct LogData value.
Avoid marshalling strings in convertToString for data field
JSON marshalling is skipped for simple string values to avoid unnecessary double encoding and improve performance. Strings are returned directly, while other types are still marshalled as before.
Omit empty fields in LogEntry JSON
The LogEntry struct fields are now tagged to be omitted when
empty.
This reduces the size of log and reduces noise while reading them.