Logs all chat messages to a file in various formats.
- Multiple output formats (JSON, CSV, plain text)
- Configurable log file location
- Optional system message logging
- File rotation support
- Statistics and management commands
config:
enabled: true
log_file: "~/.socialpie/logs/chat.log"
format: "json" # json, text, or csv
include_system_messages: false
rotate_size: "10MB"enabled(boolean): Enable or disable logginglog_file(string): Path to log file (supports ~ for home directory)format(string): Log format -json,text, orcsvinclude_system_messages(boolean): Whether to log system messagesrotate_size(string): Maximum log file size before rotation
/logstats- Show logging statistics/clearlog confirm- Clear the chat log (requires confirmation)
filesystem.write- To write log filesmessages.read- To read messages for logging
{"timestamp": "2026-01-25T10:30:45.123456", "type": "chat", "user": "Alice", "content": "Hello!", "metadata": {}}
{"timestamp": "2026-01-25T10:30:47.654321", "type": "chat", "user": "Bob", "content": "Hi Alice!", "metadata": {}}timestamp,type,user,content
"2026-01-25T10:30:45.123456","chat","Alice","Hello!"
"2026-01-25T10:30:47.654321","chat","Bob","Hi Alice!"--- Chat Log Started: 2026-01-25T10:30:00.000000 ---
[2026-01-25 10:30:45] Alice: Hello!
[2026-01-25 10:30:47] Bob: Hi Alice!
# Start server with chat logger enabled
socialpie server
# Check logging stats
/logstats
# Chat Logger Statistics:
# Messages logged: 42
# Log file: /home/user/.socialpie/logs/chat.log
# File size: 0.15 MB
# Format: json
# Clear log (careful!)
/clearlog confirm
# Chat log cleared. 42 messages removed.This plugin demonstrates:
- Hooks (
@hook) for message interception - Async file I/O with aiofiles
- Commands with confirmation
- Configuration handling
- File system operations
- Error handling
GPL-3.0-or-later