LogManager is a cross-platform log viewer built with Qt 6. It parses application logs according to user-supplied JSON format descriptions and can merge records from multiple modules into a single timeline. The interactive interface provides powerful filtering, searching and export capabilities to streamline investigation of complex systems.
- Define flexible log formats in JSON, including support for JSON lines and nested fields.
- Merge records from multiple modules into a unified timeline.
- Open individual log files or scan entire folders.
- Handle large logs efficiently with on-demand fetching.
- Filter entries by module, time range, or per-column values.
- Search locally or globally with optional regular expressions.
- Export filtered results to raw text or CSV.
- Manage available formats directly from the GUI.
This project uses CMake and requires Qt 6 and a C++20 capable compiler.
Log formats are described with JSON files. Each file specifies modules, file extensions, encoding, comment styles and either field separators or a regular expression for the entire line. Formats are loaded at startup and can be added or removed using the GUI. Each JSON file may contain the following keys:
modules- names of modules present in the log. This list is optional and used to detect if file matches this format.logFileRegex- regular expression that matches log file names. It can contain named capturing groupmodulewhich is used for filtering.extension- the log file extension associated with this format. Only files using this extension will be interpreted with the format, and the value must include the leading dot such as.log.encoding- text encoding such asUTF-8.comments- array of objects withstartand optionalfinishstrings describing line comments.separator- delimiter separating fields in a log line.lineRegex- regular expression describing the entire log line when no separator is provided. Capturing groups correspond to fields in order.lineFormat- set to"json"when each log line is a JSON object. Field names may use dot notation to access nested properties.timeFieldIndex- zero-based index of the timestamp field.timeMask- pattern used to parse the timestamp.std::get_time/strftime-style format is used.timeFractionalDigits- number of digits after the decimal point in the timestamp, used to parse fractional seconds.fields- array of field definitions. Each entry contains aname, a regular expressionregexand the Qt type for the value. When usinglineFormat"json", the name can be a dotted path likeparent.child.
An example format file looks like this:
{
"modules": ["Core", "UI"],
"logFileRegex": "log-(?<module>[[:alnum:]]*)-(?<time>\\d*)",
"extension": ".log",
"encoding": "UTF-8",
"comments": [{"start": "#"}],
"separator": ",",
"timeFieldIndex": 0,
"timeMask": "%T %F",
"timeFractionalDigits": 3,
"fields": [
{"name": "time", "regex": "^(\\d{4}-\\d{2}-\\d{2}) (\\d{2}:\\d{2}:\\d{2}.\\d{3})", "type": "QString"},
{"name": "level", "regex": "([A-Z]+)", "type": "QString"},
{"name": "message", "regex": "(.*)", "type": "QString"}
]
}Execute the binary to start the GUI. Access the Format menu to manage the list of available formats. Use the File menu to open log files or folders. After scanning, choose a time range and modules to display.