97 lines
2.7 KiB
Markdown
97 lines
2.7 KiB
Markdown
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:
|
|
|
|
```sh
|
|
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:
|
|
|
|
```sh
|
|
export GLITCHTIP_DSN="your-glitchtip-dsn"
|
|
export LOG_FILES="path/to/logfile1,path/to/logfile2"
|
|
```
|
|
|
|
After adding these lines, reload your shell configuration:
|
|
|
|
```sh
|
|
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`:
|
|
|
|
```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:
|
|
|
|
```yaml
|
|
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
|
|
|
|
```sh
|
|
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:
|
|
|
|
```sh
|
|
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:
|
|
|
|
```sh
|
|
export DEBUG=true
|
|
```
|
|
|
|
This will enable more detailed logging to help troubleshoot issues. |