Skip to content

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Log Inspector

Log Inspector Icon

A Windows desktop application for parsing, viewing, and analyzing large log files

.NET Windows License


✨ Features

  • 🎯 Template-based parsing using regular expressions
  • 🎨 Conditional row coloring based on column values
  • πŸ” Advanced filtering with multiple criteria types (equality, contains, regex, comparison)
  • ⚑ High performance with UI virtualization for handling millions of log entries
  • πŸ“ Multi-line support for stack traces and extended messages
  • πŸ“Š Live file monitoring with read-only mode and file sharing
  • πŸ’Ύ XML template storage for easy reuse and sharing
  • 🎭 Detail pane for viewing full log entry content

πŸš€ Quick Start

Prerequisites

  • Windows 10 or later
  • .NET Core 8.0+
  • Visual Studio 2022 or later (for development)

Installation

  1. Build from source:

    git clone https://github.com/valentynblaha/LogInspector.git
    cd loginspector
    # Open LogInspector.sln in Visual Studio
    # Build and run (F5)
  2. Or download the release:

    • Download the latest release from the Releases page
    • Extract and run LogInspector.exe

πŸ“– User Guide

1. Create a Template

Templates define how your log files are parsed. Each template contains:

  • A regex pattern with capture groups for each column
  • Column definitions (name, data type, format)
  • Color rules for conditional formatting

Example: Creating a Template for Java Logs

Sample Log:

2025-10-08 02:35:33,028 DEBUG no-user [com.yourapp.security.LoginManager] Connection established

Steps:

  1. Go to Template β†’ New Template
  2. Enter template name: "Java Application Log"
  3. Enter regex pattern:
    ^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3})\s+(\w+)\s+(\S+)\s+\[([^\]]+)\]\s+(.*)$
  4. Add columns:
    • Timestamp (Date) - Format: yyyy-MM-dd HH:mm:ss,fff
    • Level (Enum)
    • User (String)
    • Class (String)
    • Message (String)
  5. Add color rules:
    • Level = ERROR β†’ #FFCCCC (red)
    • Level = WARN β†’ #FFF4CC (yellow)
    • Level = INFO β†’ #E6F3FF (blue)
    • Level = DEBUG β†’ #F0F0F0 (gray)
  6. Click OK

2. Save and Load Templates

  • Save: Template β†’ Save Template (creates an XML file)
  • Load: Template β†’ Load Template (loads existing XML)
  • Edit: Template β†’ Edit Current Template

3. Open a Log File

  1. Load a template first
  2. Go to File β†’ Open Log File
  3. Select your log file
  4. The application parses and displays the logs automatically

4. Filter Logs

Apply filters to focus on specific entries:

  1. Go to Filter β†’ Add Filter
  2. Select a column (e.g., "Level")
  3. Choose an operator:
    • Equals - Exact match
    • NotEquals - Exclude specific values
    • Contains - Substring search
    • NotContains - Exclude substring
    • GreaterThan / LessThan - Numeric/date comparison
    • Regex - Pattern matching
  4. Enter the value
  5. Click OK

Example Filters:

  • Show only errors: Level = ERROR
  • Show recent logs: Timestamp > 2025-10-08
  • Find specific user: User contains batch
  • Complex pattern: Message regex (?i)exception|error

Multiple filters work together (AND logic).

5. View Details

Click any row to see the full log entry in the detail pane. This is especially useful for:

  • Multi-line stack traces
  • Long error messages
  • Wrapped text

🎨 Template Examples

Apache Access Log

Pattern:

^(\S+) \S+ \S+ \[([^\]]+)\] "(\w+) ([^"]+)" (\d{3}) (\d+)$

Columns:

  • IP (String)
  • Timestamp (Date) - dd/MMM/yyyy:HH:mm:ss zzz
  • Method (Enum)
  • URL (String)
  • Status (Number)
  • Bytes (Number)

Windows Event Log Export

Pattern:

^(\d{1,2}/\d{1,2}/\d{4} \d{1,2}:\d{2}:\d{2} [AP]M)\s+(\w+)\s+(\w+)\s+(.+)$

Columns:

  • Timestamp (Date) - M/d/yyyy h:mm:ss tt
  • Level (Enum)
  • Source (String)
  • Message (String)

Syslog Format

Pattern:

^(\w{3}\s+\d{1,2} \d{2}:\d{2}:\d{2}) (\S+) (\S+)\[(\d+)\]: (.+)$

Columns:

  • Timestamp (Date) - MMM d HH:mm:ss
  • Host (String)
  • Process (String)
  • PID (Number)
  • Message (String)

βš™οΈ Technical Details

Performance Optimizations

  • UI Virtualization: Only visible rows are rendered
  • Background Threading: File parsing doesn't block the UI
  • Filter Optimization: Filters execute in order of computational cost
  • Shared File Access: Monitor logs while they're being written

Data Types

Type Description Examples
String Plain text "ERROR", "user123"
Number Numeric values 42, 3.14, -10
Date Timestamps 2025-10-08 14:30:00
Enum Categorical DEBUG, INFO, WARN, ERROR
Boolean True/false true, false

Filter Operators

Operator Cost Description
Equals Low Exact match
NotEquals Low Exclude exact match
GreaterThan/LessThan Low Numeric/date comparison
Contains Medium Substring search
NotContains Medium Exclude substring
Regex High Pattern matching

πŸ› Troubleshooting

Problem: "No Template" error when opening files

Solution: Load or create a template first via Template β†’ New Template or Template β†’ Load Template

Problem: Regex doesn't match log lines

Solution:

  • Test your regex at regex101.com
  • Ensure capture groups match the number of columns
  • Check for escaped special characters

Problem: Dates not parsing correctly

Solution: Specify the exact date format in the column definition (e.g., yyyy-MM-dd HH:mm:ss,fff)

Problem: Colors not appearing

Solution:

  • Verify color hex codes (e.g., #FFCCCC)
  • Check that column names in color rules match exactly
  • Ensure operator matches your data (case-sensitive)

Problem: Application freezes

Solution: The app uses background threading, but very large files may take time to parse initially. Check the progress bar.


πŸ“ Template XML Format

<?xml version="1.0" encoding="utf-8"?>
<LogTemplate>
  <Name>My Template</Name>
  <RegexPattern>^(\d{4}-\d{2}-\d{2})\s+(\w+)\s+(.+)$</RegexPattern>
  <Columns>
    <ColumnDefinition>
      <HeaderName>Date</HeaderName>
      <DataType>Date</DataType>
      <DateFormat>yyyy-MM-dd</DateFormat>
    </ColumnDefinition>
    <ColumnDefinition>
      <HeaderName>Level</HeaderName>
      <DataType>Enum</DataType>
    </ColumnDefinition>
    <ColumnDefinition>
      <HeaderName>Message</HeaderName>
      <DataType>String</DataType>
    </ColumnDefinition>
  </Columns>
  <ColorRules>
    <ColorRule>
      <ColumnName>Level</ColumnName>
      <Operator>=</Operator>
      <Value>ERROR</Value>
      <ColorHex>#FFCCCC</ColorHex>
    </ColorRule>
  </ColorRules>
</LogTemplate>

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the GNU GPLv3 License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • Built with WPF (Windows Presentation Foundation)
  • Inspired by the need for better log analysis tools
  • Thanks to all contributors and users

πŸ“§ Contact

For questions, suggestions, or issues, please open an issue on GitHub.


Made with ❀️ for developers who love clean logs

About

A Windows desktop application for parsing, viewing, and analyzing large log files

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages