Package com.github.isuhorukov.log.watcher
package com.github.isuhorukov.log.watcher
The
com.github.isuhorukov.log.watcher package provides a command-line tool for reading
PostgreSQL DBMS logs in JSON format and sending them to an OpenTelemetry collector. It includes
interfaces and implementations for log enrichment, which can optionally add additional data to the logs
by fetching SQL statements from a PostgreSQL database using the pg_stat_statements extension.
The main components of this package are:
PostgreSqlJson- The command-line tool that reads PostgreSQL logs, enriches them if configured, and sends them to the OpenTelemetry collector.LogEnricher- An interface for enriching log entries with additional information from a database.EnrichmentOff- A no-op implementation of theLogEnricherinterface that disables log enrichment.LogEnricherPostgreSql- An implementation of theLogEnricherinterface that fetches SQL statements from a PostgreSQL database.VersionProvider- Provides the version information of the project for the CLI application.
This package is designed to be used as a standalone command-line application, allowing users to monitor and process PostgreSQL logs efficiently. It leverages Java's WatchService to monitor log directories for changes and uses a caching mechanism to optimize database queries.
-
ClassDescriptionA no-op implementation of
LogEnricherthat disables log enrichment.Interface for enriching log entries with additional information from a database.TheLogEnricherPostgreSqlclass implements theLogEnricherinterface to provide log enrichment from a PostgreSQL database.ThePostgreSqlJsonclass is a command-line tool for reading PostgreSQL DBMS logs in JSON format and sending them to an OpenTelemetry collector.Provides the version information of the project.