My intent with this is to enable a number of OS's to be able to have their low volume but high value log errors sent to glitchtip.
Go to file
Colin a070ef041a Merge branch 'master' of git.nixc.us:colin/inotify-glitch 2024-07-22 20:35:16 -04:00
build_logs baseline 2024-07-22 20:26:18 -04:00
dist baseline 2024-07-22 20:26:18 -04:00
README.md Fixed docs and test.sh 2024-07-22 20:35:01 -04:00
build.sh baseline 2024-07-22 20:26:18 -04:00
go.mod baseline 2024-07-22 20:26:18 -04:00
go.sum baseline 2024-07-22 20:26:18 -04:00
install.sh Update install.sh 2024-07-23 00:27:24 +00:00
main.go baseline 2024-07-22 20:26:18 -04:00
test.sh Fixed docs and test.sh 2024-07-22 20:35:01 -04:00

README.md

Certainly! Here is the updated README without the mentions of license or contributions:

Inotify-Glitch

Inotify-Glitch is a command-line utility that reads log messages from files and sends them to Glitchtip, a self-hosted Sentry-compatible error tracking system. This tool provides a more reliable alternative to sentry-cli for streaming and reading log files.

Installation

To install the binary locally, you can use the provided installation script. Run the following command in your terminal:

curl -sSL https://git.nixc.us/colin/inotify-glitch/raw/branch/master/install.sh | bash

This will download and install the Inotify-Glitch binary to your local machine.

Usage

You can use Inotify-Glitch by specifying log files through environment variables.

Setting Up Environment Variables

Inotify-Glitch requires the GLITCHTIP_DSN environment variable to be set with your Glitchtip DSN and the LOG_FILES environment variable to list the log files to monitor.

Shell Environment

Add the following lines to your .zshrc or .bashrc file:

export GLITCHTIP_DSN="your-glitchtip-dsn"
export LOG_FILES="path/to/logfile1,path/to/logfile2"

After adding these lines, reload your shell configuration:

source ~/.zshrc # for zsh users
source ~/.bashrc # for bash users

Dockerfile

If you are using a Docker container, add the environment variables in your Dockerfile:

ENV GLITCHTIP_DSN=your-glitchtip-dsn
ENV LOG_FILES=/path/to/logfile1,/path/to/logfile2

docker-compose.yml

If you are using Docker Compose, add the environment variables in your docker-compose.yml file:

version: '3.8'

services:
  inotify-glitch:
    image: your-docker-image
    environment:
      - GLITCHTIP_DSN=your-glitchtip-dsn
      - LOG_FILES=/path/to/logfile1,/path/to/logfile2

Running Inotify-Glitch

Once you have set up the necessary environment variables, you can start Inotify-Glitch to monitor the specified log files.

Running Directly

inotify-glitch

Example: Appending an Error Line to a Log File

To see Inotify-Glitch in action, append an error line to one of the monitored log files:

echo "This is an error line" >> /path/to/logfile1

Inotify-Glitch will detect the change and send the error message to Glitchtip.

Development and CI/CD

This project aims to provide a more reliable logging solution. In the future, I plan to set up a CI/CD process that will upload the executables automatically and make this project public.

Debug Mode

To enable debug mode, set the DEBUG environment variable:

export DEBUG=true

This will enable more detailed logging to help troubleshoot issues.