A customizable Log Viewer with ability to create custom providers. Can be used with C#, C++, Python, Java and others
A log viewer that can parse log files and stream logs from C#, Python, Java and others. You can also implement your own parsers or request to add new parsers for other logs
Standalone User Controls:
User Control | Description | Nuget Version |
---|---|---|
LogMessagesUC | Embedded Log Viewer Grid Control | -- |
PlotterUC | Embedded Plotting Control | -- |
You can use those in your winforms apps Examples:
Usage and how to create custom data providers
Analogy Log Viewer is multi purpose Log Viewer for Windows Operating systems.
Some features of this tool are:
Main interaction UI:
The application supports the followings data providers:
Common logs frameworks like: Serilog, NLog, Log4Net, Microsoft Logging.
Generic file types: Json Parser and XML parser.
Real time streaming from the following languages: C#, C++, Python and JAVA using gRPC log Server and client.
Custom providers. Create specific parsers for specific applications.
There are 3 modes of operations:
If you need you can create your own providers: to implement a new data provider do the following:
Create new cs project and make sure your assembly is named Analogy.LogViewer.*.dll.
reference nugets package Analogy.LogViewer.Interfaces and Analogy.LogViewer.Template
inherite Analogy.LogViewer.Template.PrimaryFactory
class from the template and override some properties:
public class PrimaryFactory : Analogy.LogViewer.Template.PrimaryFactory
{
internal static Guid Id { get; }= new Guid("XXXXXXXX");
public override Guid FactoryId { get; set; } = Id;
public override string Title { get; set; } = "Name of your provider (like Serilog, Nlog)";
public override IEnumerable<IAnalogyChangeLog> ChangeLog { get; set; } = ChangeLogList.GetChangeLog();
public override IEnumerable<string> Contributors { get; set; } = new List<string> { "Lior Banai" };
public override string About { get; set; } = "Analogy Log Parser";
public override Image? SmallImage { get; set; } = Resources.Image16x16;
public override Image? LargeImage { get; set; } = Resources.Image32x32;
}
The FactoryId is the identifier of your provider. all other providers (real time, offline) refer to this identifier to group them under the tab in the U.
public class DataProvidersFactory : LogViewer.Template.DataProvidersFactory
{
public override Guid FactoryId { get; set; } = PrimaryFactory.Id;
public override string Title { get; set; } = "Log Parsers";
public override IEnumerable<IAnalogyDataProvider> DataProviders { get; set; } = new List<IAnalogyDataProvider>
{new SomeOfflineDataProvider(), new OnlinelineDataProvider() };
}
Analogy.LogViewer.Template.OfflineDataProvider
and at minimum override the Parse methods and some properties like Id: public class OfflineDataProvider : Analogy.LogViewer.Template.OfflineDataProvider
{
public override Image? SmallImage { get; set; } = null;
public override Image? LargeImage { get; set; } = null;
public override string? OptionalTitle { get; set; } = "Some Parser";
public override string FileOpenDialogFilters { get; set; } = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
public override IEnumerable<string> SupportFormats { get; set; } = new List<string> { "*.txt" };
public override string? InitialFolderFullPath { get; set; } = Environment.CurrentDirectory;
public override Guid Id { get; set; } = new Guid("XXXX");
private PlainTextLogFileParser parser=new PlainTextLogFileParser();
public override Task<IEnumerable<AnalogyLogMessage>> Process(string fileName, CancellationToken token,ILogMessageCreatedHandler messagesHandler)
=> parser.Process(fileName, token, messagesHandler);
Analogy.LogViewer.Template.OnlineDataProvider
and again override needed members.you can use exisitng projects (like PowerToys Parser for offline and Windows Event logs for real time) another option is to check the Analogy.LogViewer.Example example.
Along with custom Data Providers you can create extensions for existing providers:
The example data provider has example for this (you need to enable the extension in the extensions tab in the user settings).
Discuss about the extension here: Extension Disscussion
Along with custom Data Providers you can create Plots of arbitrary data by implementing the IAnalogyPlotting
Interface:
public interface IAnalogyPlotting
{
event EventHandler<AnalogyPlottingPointData> OnNewPointData;
IEnumerable<(string SeriesName, AnalogyPlottingSeriesType SeriesViewType)> GetChartSeries();
Guid Id { get; set; }
/// <summary>
/// the factory id which this Data providers factory belongs to
/// </summary>
Guid FactoryId { get; set; }
string Title { get; set; }
Task InitializePlottingAsync(IAnalogyLogger logger);
Task StartPlotting();
Task StopPlotting();
}
}
The example data provider has example for this:
You can select the chart's layout from the UI:
Discuss about the plotting here: Extension Disscussion
The application has some analyzers and visualization.
Time Distribution: shows at what time of day the message was logged.
Frequency: shows count of how many repeated messages were logged (you can define the text to filter).
On/Off Distribution: Show existance of message along the time.
Pie Charts: shows pie charts per source/module/log level.
Json Visualizer:
Data Provider | Description |
---|---|
gRPC Real Time Data Provider | A gRPC Data provider that connect to Analogy Log Server and read message back to Analogy Log Viewer |
Analogy.AspNetCore.LogProvider | A AspNetCore provider that streams logs to Analogy Log Server |
Analogy.LogViewer.NLog.Targets | NLog Target that streams logs to Analogy Log Server |
Serilog Sink | Serilog Sink that streams logs to Analogy Log Server |
Windows event logs | Real time Component of Windows Event logs Parser |
Data Provider | Description |
---|---|
Serilog Parser | Parser for Serilog log files |
NLog Parser | Parser for NLog log files |
Log4Net Parser | Parser for Log4Net log files |
Regular Expression Parser | Regular Expression Parser |
IIS log Parser | Parser for IIS log files |
RSS Reader | RSS Feeds inside Analogy Log Viewer |
Generic Json Log Parser | Generic Json Parser |
XML Parser | Generic XML Parser |
Windows event logs | Windows Event logs Parser |
Plain Text Parser | Plain Text Parser |
Git History | Display your Git Repository commit history |
Kafka Producer/ consumer | Kafka Producer / Consumer |