|
2 | 2 | <img src="icon.png" alt="FolderLog icon" width="120"/> |
3 | 3 | </p> |
4 | 4 |
|
| 5 | +<p align="center"> |
| 6 | + <img src="icon.svg" alt="FolderLog icon" width="120"/> |
| 7 | +</p> |
| 8 | + |
| 9 | +# FolderLog |
| 10 | + |
| 11 | +FolderLog is a minimal Docker container to watch folders and log file changes. |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## Features |
| 16 | +- Recursive monitoring of all top-level directories in `/watched` |
| 17 | +- Logs written to `/logs` |
| 18 | +- One log file per folder |
| 19 | +- Configurable log file extension (`LOG_EXT`) |
| 20 | +- Optional exclusion regex (`EXCLUDE_REGEX`) |
| 21 | +- Minimal CPU and memory usage (Alpine + inotify-tools) |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +## Usage |
| 26 | +Mount your folders and logs: |
| 27 | + |
| 28 | +### Docker Compose |
| 29 | +```yaml |
| 30 | +version: "3.9" |
| 31 | +services: |
| 32 | + folderlog: |
| 33 | + image: ghcr.io/diegocjorge/folderlog:latest |
| 34 | + container_name: folderlog |
| 35 | + volumes: |
| 36 | + - ./folder1:/watched/folder1:ro |
| 37 | + - ./folder2:/watched/folder2:ro |
| 38 | + - ./logs:/logs |
| 39 | + environment: |
| 40 | + - LOG_EXT=.txt |
| 41 | + # - EXCLUDE_REGEX=.*\.tmp #optional |
| 42 | + restart: unless-stopped |
| 43 | +``` |
| 44 | +
|
| 45 | +### Docker Run Example |
| 46 | +```bash |
| 47 | +docker run -d \ |
| 48 | + -v ./folder1:/watched/folder1:ro \ |
| 49 | + -v ./folder2:/watched/folder2:ro \ |
| 50 | + -v ./logs:/logs \ |
| 51 | + -e LOG_EXT=.txt \ |
| 52 | + ghcr.io/diegocjorge/folderlog:latest |
| 53 | +``` |
| 54 | + |
| 55 | +### Notes |
| 56 | + |
| 57 | +* You can mount **multiple directories** directly under `/watched` by specifying multiple `-v` options in your Docker run command. |
| 58 | +* Each top-level folder inside `/watched` will have its own separate log file named after the folder (e.g., `folder1.txt`, `folder2.txt`). |
| 59 | +* Events from subfolders are included in their parent folder’s log file. |
| 60 | + |
| 61 | +--- |
| 62 | + |
| 63 | +## Environment Variables |
| 64 | + |
| 65 | +| Variable | Description | Example Values | |
| 66 | +|---------------|----------------------------------------------|---------------------------------------| |
| 67 | +| `LOG_EXT` | File extension for log files (default `.log`) | `.log`, `.txt` | |
| 68 | +| `EXCLUDE_REGEX` | Regex pattern to exclude files or folders from logging | `.*\.tmp` | |
| 69 | + |
| 70 | +- **Simple regex example:** Exclude all files ending with `.tmp` |
| 71 | + `EXCLUDE_REGEX=.*\.tmp` |
| 72 | + |
| 73 | +- **Advanced regex example:** Exclude any files/folders inside `tmp` or `cache` directories |
| 74 | + `EXCLUDE_REGEX=.*/(tmp|cache)/.*` |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +## License |
| 79 | +MIT License |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
5 | 91 | # FolderLog |
6 | 92 |
|
7 | 93 | **FolderLog** is a lightweight Docker container that monitors **all directories inside `/watched`**. |
@@ -102,22 +188,3 @@ Each log entry includes a timestamp, event type, and affected file or folder pat |
102 | 188 |
|
103 | 189 | This makes it easy to track changes and events inside each monitored folder. |
104 | 190 |
|
105 | | ---- |
106 | | - |
107 | | -## Environment Variables |
108 | | - |
109 | | -| Variable | Description | Example Values | |
110 | | -|---------------|----------------------------------------------|---------------------------------------| |
111 | | -| `LOG_EXT` | File extension for log files (default `.log`) | `.log`, `.txt` | |
112 | | -| `EXCLUDE_REGEX` | Regex pattern to exclude files or folders from logging | `.*\.tmp` | |
113 | | - |
114 | | -- **Simple regex example:** Exclude all files ending with `.tmp` |
115 | | - `EXCLUDE_REGEX=.*\.tmp` |
116 | | - |
117 | | -- **Advanced regex example:** Exclude any files/folders inside `tmp` or `cache` directories |
118 | | - `EXCLUDE_REGEX=.*/(tmp|cache)/.*` |
119 | | - |
120 | | ---- |
121 | | - |
122 | | -## License |
123 | | -MIT License |
|
0 commit comments