Skip to content

Commit a9a55dc

Browse files
committed
feat: Update logging configuration and add detailed logging documentation
1 parent 661960a commit a9a55dc

File tree

3 files changed

+405
-34
lines changed

3 files changed

+405
-34
lines changed

README.md

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -641,45 +641,27 @@ return [
641641

642642
## Logging
643643

644-
Icon Manager uses the [LindemannRock Logging Library](https://github.com/LindemannRock/craft-logging-library) for centralized, structured logging across all LindemannRock plugins.
644+
Icon Manager uses the [LindemannRock Logging Library](https://github.com/LindemannRock/craft-logging-library) for centralized, structured logging.
645645

646-
### Log Levels
647-
- **Error**: Critical errors only
646+
**Log Levels:**
647+
- **Error**: Critical errors only (default)
648648
- **Warning**: Errors and warnings
649649
- **Info**: General information
650-
- **Debug**: Detailed debugging (includes performance metrics, requires devMode)
650+
- **Debug**: Detailed debugging (requires devMode)
651651

652-
### Configuration
652+
**Configuration:**
653653
```php
654654
// config/icon-manager.php
655655
return [
656-
'logLevel' => 'info', // error, warning, info, or debug
656+
'logLevel' => 'error', // error, warning, info, or debug
657657
];
658658
```
659659

660-
**Note:** Debug level requires Craft's `devMode` to be enabled. If set to debug with devMode disabled, it automatically falls back to info level.
661-
662-
### Log Files
663-
- **Location**: `storage/logs/icon-manager-YYYY-MM-DD.log`
664-
- **Retention**: 30 days (automatic cleanup via Logging Library)
665-
- **Format**: Structured JSON logs with context data
666-
- **Web Interface**: View and filter logs in CP at Icon Manager → Logs
667-
668-
### What's Logged
669-
- **Error**: File system failures, SVG parsing errors, database errors
670-
- **Warning**: Missing icons, empty content, slow operations (>1s)
671-
- **Info**: Icon set operations, cache clears, major actions
672-
- **Debug**: Cache hits/misses, performance timing, API requests, detailed SVG processing
673-
674-
### Log Management
675-
Access logs through the Control Panel:
676-
1. Navigate to Icon Manager → Logs
677-
2. Filter by date, level, or search terms
678-
3. Download log files for external analysis
679-
4. View file sizes and entry counts
680-
5. Auto-cleanup after 30 days (configurable via Logging Library)
681-
682-
**Requires:** `lindemannrock/logginglibrary` plugin (installed automatically as dependency)
660+
**Log Files:**
661+
- Location: `storage/logs/icon-manager-YYYY-MM-DD.log`
662+
- Web Interface: Icon Manager → Logs in Control Panel
663+
664+
See [docs/LOGGING.md](docs/LOGGING.md) for detailed logging documentation.
683665

684666
## Environment-Specific Paths
685667

docs/CONFIGURATION.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ return [
3939
'scanWidthHeightWithViewBox' => false, // Detect width/height with viewBox (optional)
4040

4141
// Logging settings
42-
'logLevel' => 'info', // error, warning, info, debug
42+
'logLevel' => 'error', // error, warning, info, debug
4343

4444
// Icon types to enable
4545
'enabledIconTypes' => [
@@ -132,7 +132,7 @@ return [
132132
'enableCache' => getenv('ICON_MANAGER_CACHE') === 'true',
133133
'cacheDuration' => (int)getenv('ICON_CACHE_DURATION') ?: 86400,
134134
'iconSetsPath' => getenv('ICON_SETS_PATH') ?: '@root/icons',
135-
'logLevel' => getenv('ICON_LOG_LEVEL') ?: 'info',
135+
'logLevel' => getenv('ICON_LOG_LEVEL') ?: 'error',
136136
];
137137
```
138138

@@ -212,10 +212,10 @@ Control what the scanner detects as optimization opportunities. **Note:** These
212212
#### Logging Settings
213213

214214
- **logLevel**: Logging verbosity level
215-
- `error` - Critical errors only
215+
- `error` - Critical errors only (default, production recommended)
216216
- `warning` - Errors and warnings
217-
- `info` - General information (recommended for production)
218-
- `debug` - Detailed debugging with performance metrics (development only)
217+
- `info` - General information
218+
- `debug` - Detailed debugging with performance metrics (development only, requires devMode)
219219

220220
#### Icon Type Settings
221221

0 commit comments

Comments
 (0)