{"repo":"veqryn/slog-dedup","free":true,"listed":false,"github":"https://github.com/veqryn/slog-dedup","clone":"git clone https://github.com/veqryn/slog-dedup.git","description":"Golang structured logging (slog) deduplication and sorting for use with json logging","language":"Go","stars":24,"topics":["dedup","deduplication","golang","golang-library","json","logging","slog","structured-logging"],"license":"MIT","category":"analytics","readme_excerpt":"slog-dedup Golang structured logging (slog) deduplication for use with json logging (or any other format where duplicates are not appreciated). The slog handlers in this module are \"middleware\" handlers. When creating them, you must pass in another handler, which will be called after this handler has finished handling a log record. Because of this, these handlers can be chained with other middlewares, and can be used with many different final handlers, whether from the stdlib or third-party, such as json, protobuf, text, or data sinks. The main impetus behind this package is because most JSON tools do not like duplicate keys for their member properties/fields. Some of them will give errors or fail to parse the log line, and some may even crash. Unfortunately the default behavior of the stdlib slog handlers is to allow duplicate keys: Outputs: With this in mind, this repo was created with several different ways of deduplicating the keys: overwriting, ignoring, appending, incrementing. For example, incrementing: Additionally, this library includes convenience methods for formatting output to match what is expected for various log aggregation tools (such as Graylog), as well as cloud providers (such as Stackdriver / Google Cloud Operations / GCP Log Explorer). Other Great SLOG Utilities - slogctx: Add attributes to context and have them automatically added to all log lines. Work with a logger stored in context. - slogotel: Automatically extract and add OpenTelemetry TraceID's to","default_branch":null,"files":null,"tree":[],"storefront":"/r/veqryn","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/veqryn/slog-dedup/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}