Configuration
SimpleLogs can be configured through VS Code settings. Here's a comprehensive guide to all available configuration options.
Accessing Settings
You can access SimpleLogs settings in two ways:
From VS Code Settings UI:
- Go to File > Preferences > Settings (or Code > Preferences > Settings on macOS)
- Search for "logMonitor" or "SimpleLogs"
Directly in
settings.json
:- Open the command palette (
Ctrl+Shift+P
orCmd+Shift+P
) - Type "Open Settings (JSON)"
- Add or modify settings in the JSON file
- Open the command palette (
Basic Settings
Files to Monitor
"logMonitor.files": [
"/var/log/nginx/access.log",
"${workspaceFolder}/logs/application.log"
]
This setting specifies which log files to monitor. You can use absolute paths or workspace-relative paths using ${workspaceFolder}
.
Maximum Display Lines
"logMonitor.maxDisplayLines": 1000
Controls how many lines are displayed at once in the log view. Adjusting this can improve performance for very large logs.
Refresh Mode
"logMonitor.refreshMode": "realtime"
Determines how log updates are detected:
"realtime"
: Uses file watchers for immediate updates"poll"
: Periodically checks for changes
Poll Interval
"logMonitor.pollInterval": 1000
If using polling mode, this sets how often (in milliseconds) to check for file changes.
Appearance Settings
Syntax Highlighting
"logMonitor.syntaxHighlighting": true
Enables or disables syntax highlighting for supported log formats.
Highlight Patterns
"logMonitor.highlightPatterns": [
{ "pattern": "ERROR", "color": "#FF0000" },
{ "pattern": "WARNING", "color": "#FFA500" }
]
Custom patterns to highlight in logs. Each pattern has a regex string and a color.
Auto-Scroll Default
"logMonitor.autoScrollDefault": true
Sets the default auto-scroll behavior for new log views.
Feature Settings
Analysis Features
"logMonitor.analyzeErrors": true
Enables basic error analysis and statistics.
Multi-View Support
"logMonitor.enableMultiView": true
Enables side-by-side viewing of multiple logs.
Bookmarks
"logMonitor.bookmarksEnabled": true
Enables bookmarking and annotations for log entries.
Collapsible Sections
"logMonitor.collapsibleSections": true
Enables folding of repetitive log sections.
Advanced Filtering
"logMonitor.advancedFiltering": true
Enables regex and time-based filtering.
Dashboard
"logMonitor.dashboardEnabled": true
Enables statistics dashboard view.
Complete Example
Here's a complete configuration example:
{
"logMonitor.files": [
"/var/log/nginx/access.log",
"${workspaceFolder}/logs/application.log"
],
"logMonitor.maxDisplayLines": 1000,
"logMonitor.refreshMode": "realtime",
"logMonitor.pollInterval": 1000,
"logMonitor.highlightPatterns": [
{ "pattern": "ERROR", "color": "#FF0000" },
{ "pattern": "WARNING", "color": "#FFA500" },
{ "pattern": "INFO", "color": "#00BFFF" },
{ "pattern": "DEBUG", "color": "#90EE90" }
],
"logMonitor.syntaxHighlighting": true,
"logMonitor.analyzeErrors": true,
"logMonitor.enableMultiView": true,
"logMonitor.bookmarksEnabled": true,
"logMonitor.autoScrollDefault": true,
"logMonitor.collapsibleSections": true,
"logMonitor.advancedFiltering": true,
"logMonitor.dashboardEnabled": true
}
Per-workspace Configuration
You can have different configurations for different workspaces by adding these settings to your workspace settings file. This allows you to have different log files and behaviors depending on the project you're working on.