Files
aitbc/DEV_LOGS_QUICK_REFERENCE.md
AITBC System f74a208cbc ```
chore(gitignore): add development log file patterns

- Add patterns for .log, .out, and .err files
- Add wget-log and download.log patterns
- Organize under new "Development Logs" section
```
2026-03-08 12:16:01 +01:00

4.4 KiB

AITBC Development Logs - Quick Reference

🎯 Problem Solved:

  • wget-log moved from project root to /opt/aitbc/dev/logs/tools/
  • Prevention measures implemented to avoid future scattered logs
  • Log organization system established

📁 New Log Structure:

/opt/aitbc/dev/logs/
├── archive/          # Old logs organized by date
├── current/          # Current session logs
├── tools/            # Download logs, wget logs, curl logs
├── cli/              # CLI operation logs
├── services/         # Service-related logs
└── temp/             # Temporary logs

🛡️ Prevention Measures:

1. Environment Configuration:

# Load log environment (automatic in .env.dev)
source /opt/aitbc/.env.dev.logs

# Environment variables available:
$AITBC_DEV_LOGS_DIR      # Main logs directory
$AITBC_CURRENT_LOG_DIR   # Current session logs
$AITBC_TOOLS_LOG_DIR     # Tools/download logs
$AITBC_CLI_LOG_DIR       # CLI operation logs
$AITBC_SERVICES_LOG_DIR  # Service logs

2. Log Aliases:

devlogs              # cd to main logs directory
currentlogs          # cd to current session logs
toolslogs            # cd to tools logs
clilogs              # cd to CLI logs
serviceslogs         # cd to service logs

# Logging commands:
wgetlog <url>        # wget with proper logging
curllog <url>        # curl with proper logging
devlog "message"     # add dev log entry
cleanlogs            # clean old logs (>7 days)
archivelogs          # archive current logs (>1 day)

3. Management Tools:

# View logs
./dev/logs/view-logs.sh tools     # view tools logs
./dev/logs/view-logs.sh current   # view current logs
./dev/logs/view-logs.sh recent    # view recent activity

# Organize logs
./dev/logs/organize-logs.sh       # organize scattered logs

# Clean up logs
./dev/logs/cleanup-logs.sh        # cleanup old logs

4. Git Protection:

# .gitignore updated to prevent log files in project root:
*.log
*.out
*.err
wget-log
download.log

🚀 Best Practices:

DO:

Use wgetlog <url> instead of wget <url>
Use curllog <url> instead of curl <url>
Use devlog "message" for development notes
Store all logs in /opt/aitbc/dev/logs/
Use log aliases for navigation
Clean up old logs regularly

DON'T:

Create log files in project root
Use wget without -o option
Use curl without output redirection
Leave scattered log files
Ignore log organization

📋 Quick Commands:

For Downloads:

# Instead of: wget http://example.com/file
# Use: wgetlog http://example.com/file

# Instead of: curl http://example.com/api
# Use: curllog http://example.com/api

For Development:

# Add development notes
devlog "Fixed CLI permission issue"
devlog "Added new exchange feature"

# Navigate to logs
devlogs
toolslogs
clilogs

For Maintenance:

# Clean up old logs
cleanlogs

# Archive current logs
archivelogs

# View recent activity
./dev/logs/view-logs.sh recent

🎉 Results:

Before:

  • wget-log in project root
  • Scattered log files everywhere
  • No organization system
  • No prevention measures

After:

  • All logs organized in /opt/aitbc/dev/logs/
  • Proper directory structure
  • Prevention measures in place
  • Management tools available
  • Git protection enabled
  • Environment configured

🔧 Implementation Status:

Component Status Details
Log Organization COMPLETE All logs moved to proper locations
Directory Structure COMPLETE Hierarchical organization
Prevention Measures COMPLETE Aliases, environment, git ignore
Management Tools COMPLETE View, organize, cleanup scripts
Environment Config COMPLETE Variables and aliases loaded
Git Protection COMPLETE Root log files ignored

🚀 Future Prevention:

  1. Automatic Environment: Log aliases loaded automatically
  2. Git Protection: Log files in root automatically ignored
  3. Cleanup Scripts: Regular maintenance automated
  4. Management Tools: Easy organization and viewing
  5. Documentation: Clear guidelines and best practices

🎯 The development logs are now properly organized and future scattered logs are prevented!