Skip to main content

Quick Start

This displays a rich overview of your log file:

Core Features

Log Filtering

Filter log entries using multiple criteria:

Scenario Conversion for Analysis

Convert log entries to EDSL scenarios for advanced analysis:
Available scenario fields: - timestamp_str: Formatted timestamp - logger_name: Full logger name - logger_module: Last part of logger name - level: Log level (ERROR, INFO, etc.) - level_int: Numeric level for comparison - message: Log message content - raw_line: Original log line - hour, minute, weekday: Time components - date_str: Date in YYYY-MM-DD format - is_error: Boolean for ERROR/CRITICAL levels - is_warning_or_above: Boolean for WARNING+ levels - has_exception: Boolean if message contains “exception” - has_failed: Boolean if message contains “fail” - message_length: Character count of message - words_count: Word count of message

Using Log Scenarios with EDSL

Analyze log entries using EDSL questions:

Pattern Analysis

Extract insights from log patterns:

Statistics and Reporting

Get comprehensive statistics about your logs:

Export and Sharing

Export filtered logs or share via Expected Parrot:

Log Maintenance

Archive Logs

Create timestamped backups of your logs:
The archive process shows detailed progress:

Clear Logs

Remove all log entries to start fresh:
The clear process includes safety confirmation:

Advanced Usage

Custom Log Files

Work with non-default log files:

Filtering Best Practices

Combine filters for precise results:

Performance Optimization

LogManager automatically caches statistics for better performance:

Integration Examples

Debugging Workflows

Monitoring Automation

Research and Analysis

Jupyter Notebook Integration

LogManager provides rich HTML displays in Jupyter notebooks:
The HTML display includes: - Overview with file path, entry count, and date range - Color-coded log level distribution (red for errors, blue for info) - Top loggers table with counts - Interactive command examples with syntax highlighting

API Reference

LogManager Class

class LogManager(log_file_path=None)
Main class for EDSL log management.
get_filtered_entries(**kwargs)
Filter log entries by various criteria.
to_scenario_list(entries=None, **filter_kwargs)
Convert log entries to EDSL scenarios.
analyze_patterns(**filter_kwargs)
Analyze log patterns and extract insights.
get_stats(entries=None)
Get statistics about log entries.
export_filtered_logs(output_path, **filter_kwargs)
Export filtered log entries to file.
archive(archive_path=None, clear_after_archive=True, compress=True, confirm=False)
Archive log file with timestamp.
clear(confirm=False)
Clear all log entries.

LogEntry Class

class LogEntry
Represents a parsed log entry.

Best Practices

Safety Guidelines

  • Always use confirmation prompts for destructive operations (default behavior)
  • Archive logs before clearing in production environments
  • Use specific filters to avoid processing unnecessary log entries
  • Test complex regex patterns with small datasets first

Performance Tips

  • Use n parameter to limit results when exploring large logs
  • Combine multiple filters in single calls rather than chaining
  • Cache LogManager instances when doing multiple operations
  • Consider archiving very large log files before analysis

Common Patterns

Error Investigation:
  1. Filter recent errors: get_filtered_entries(level='ERROR', since_hours=24)
  2. Convert to scenarios for analysis: to_scenario_list()
  3. Use EDSL questions to categorize and analyze
  4. Export findings or share via Expected Parrot
Regular Maintenance:
  1. Weekly archive: archive() (includes clearing)
  2. Monitor critical issues: get_filtered_entries(level='CRITICAL')
  3. Pattern analysis: analyze_patterns() for trends
Debugging Workflows:
  1. Filter by component: logger_pattern='component_name'
  2. Time-bound investigation: since_hours=X for specific incidents
  3. Pattern matching: pattern='specific_error_text'
  4. Export for sharing: export_filtered_logs()

Troubleshooting

Common Issues

Log file not found: Check the log file path. EDSL logs are typically at ~/.edsl/logs/edsl.log No entries returned:
  • Verify log file has content: log_manager.get_stats()
  • Check filter criteria are not too restrictive
  • Ensure date ranges are correct
Performance issues with large logs:
  • Use n parameter to limit results
  • Consider archiving old entries
  • Filter by time ranges first, then other criteria
Permission errors:
  • Ensure read access to log file
  • For archive/clear operations, ensure write access to log directory

Getting Help

  • View available commands: print(log_manager)
  • Check method documentation: help(log_manager.method_name)
  • View log overview: log_manager.get_stats()
  • Test filters with small limits: get_filtered_entries(n=10, ...)
The LogManager provides powerful capabilities for understanding, analyzing, and maintaining your EDSL logs. Whether you’re debugging issues, monitoring system health, or conducting research on usage patterns, LogManager offers the tools you need for effective log management.