Skip to content

Commit 58b8d26

Browse files
committed
pysyslog
1 parent 021f441 commit 58b8d26

File tree

1,978 files changed

+370829
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,978 files changed

+370829
-4
lines changed

QUICK_TEST.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Quick Test Guide
2+
3+
## Development Mode Testing (No Sudo Required)
4+
5+
You've already completed steps 1-2! Here's how to test:
6+
7+
### Step 1: Verify Installation ✓
8+
```bash
9+
# You've already done this:
10+
python3 -m venv venv
11+
source venv/bin/activate
12+
pip install -r requirements.txt
13+
pip install -e .
14+
```
15+
16+
### Step 2: Run Tests ✓
17+
```bash
18+
# Run the test script
19+
python3 test_example_config.py
20+
```
21+
22+
Expected output:
23+
```
24+
Testing demo flow...
25+
✓ Demo flow processed 2 messages
26+
Testing filtered flow...
27+
✓ Filtered flow processed 1 message(s)
28+
Testing reliable flow with channel...
29+
✓ Reliable flow processed 2 messages
30+
✓ All tests passed!
31+
```
32+
33+
### Step 3: Test Manually
34+
```bash
35+
# Run with example configuration
36+
# This will run in foreground - press Ctrl+C to stop
37+
python3 -m pysyslog -c etc/pysyslog/main.ini.example --log-level DEBUG
38+
```
39+
40+
## Important: Development vs System Installation
41+
42+
### Development Mode (What You're Using Now)
43+
- ✅ No sudo required
44+
- ✅ Uses config files from repository (`etc/pysyslog/main.ini.example`)
45+
- ✅ Runs in your terminal
46+
- ✅ Perfect for testing and development
47+
- ❌ No systemd service
48+
- ❌ No `/etc/pysyslog/` directory
49+
50+
### System Installation (Requires Sudo)
51+
- ✅ Runs as system service
52+
- ✅ Uses `/etc/pysyslog/main.ini`
53+
- ✅ Starts automatically on boot
54+
- ❌ Requires sudo/root access
55+
- ❌ Requires running `sudo ./install.sh`
56+
57+
## Common Commands
58+
59+
### Development Mode
60+
```bash
61+
# Test the application
62+
python3 test_example_config.py
63+
64+
# Run manually
65+
python3 -m pysyslog -c etc/pysyslog/main.ini.example --log-level DEBUG
66+
67+
# Test configuration loading
68+
python3 -c "
69+
import sys
70+
sys.path.insert(0, 'src')
71+
from pysyslog.config import ConfigLoader
72+
config = ConfigLoader().load('etc/pysyslog/main.ini.example')
73+
print(f'Loaded {len(config.flows)} flows')
74+
"
75+
```
76+
77+
### System Installation (If You Want Full Installation)
78+
```bash
79+
# Only run this if you want system-wide installation
80+
sudo ./install.sh
81+
82+
# Then configure
83+
sudo cp etc/pysyslog/main.ini.example /etc/pysyslog/main.ini
84+
sudo systemctl restart pysyslog
85+
```
86+
87+
## Troubleshooting
88+
89+
### "No such file or directory" for /etc/pysyslog
90+
- **Cause**: You're in development mode, not system installation
91+
- **Solution**: Use `etc/pysyslog/main.ini.example` instead of `/etc/pysyslog/main.ini`
92+
93+
### "Unit pysyslog.service not found"
94+
- **Cause**: System installation hasn't been done
95+
- **Solution**: Either run `sudo ./install.sh` OR continue using development mode
96+
97+
### Want to test without system installation?
98+
- ✅ You're already set up correctly!
99+
- ✅ Just use: `python3 -m pysyslog -c etc/pysyslog/main.ini.example`
100+
- ✅ No sudo needed!
101+

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,18 @@ For quick testing without system installation:
125125
# 1. Install in development mode (no sudo needed)
126126
python3 -m venv venv
127127
source venv/bin/activate
128+
pip install -r requirements.txt
128129
pip install -e .
129130

130-
# 2. Test with example configuration
131-
python3 -m pysyslog -c etc/pysyslog/main.ini.example --log-level DEBUG
132-
133-
# Or run the test script
131+
# 2. Run the test script to verify everything works
134132
python3 test_example_config.py
133+
134+
# 3. Test with example configuration (runs in foreground, press Ctrl+C to stop)
135+
python3 -m pysyslog -c etc/pysyslog/main.ini.example --log-level DEBUG
135136
```
136137

138+
**Note:** In development mode, you don't need `/etc/pysyslog/` or systemd. Just use the config files from the repository directly (e.g., `etc/pysyslog/main.ini.example`).
139+
137140
### Command Line
138141

139142
Start PySyslog LFC:

0 commit comments

Comments
 (0)