Skip to content

Latest commit

 

History

History
185 lines (146 loc) · 9.41 KB

README.md

File metadata and controls

185 lines (146 loc) · 9.41 KB

Analogy Log Viewer

Codacy Badge Gitter Build Status .NET Core Desktop Dependabot Status Issues GitHub closed issues License Latest Release Commits Since Latest Release

A log viewer that can parse log files and stream logs from C#, Python, Java and others.

Content

General

Usage and how to create custom data providers

Logs Analysis and Visualizers

Issues

Contact

General

Analogy Log Viewer is multi purpose Log Viewer for Windows Operating systems with support for most log frameworks log files: it supports both offline log files:

  1. Supports common frameworks like Serilog, NLog, etc.
  2. Supports generic log files like plain text with Regex parser and XML/Json parsers.

And real time streaming of logs:

  1. NLog Target
  2. Serilog Sink
  3. Asp Core log provider
  4. Python streaming

For a complete list visit Analogy Overview repository.

The application has many standard operations for analysis logs (like filtering, excluding) but its strength is in the ability to add additional custom data sources by implementing few interfaces. This allows adding any logs formats and/or custom modification of logs before presenting the data in the UI Layer.

Some features of this tool are:

  1. Windows event log support (evtx files)
  2. Aggregation into single view.
  3. Search in multiple files
  4. Combine multiple files
  5. Compare logs
  6. Themes support
  7. 64 bit support (allow loading more files)
  8. Personalization (users settings per user)
  9. Columns Extendable: Ability to add more columns specific to the data source implementation
  10. Exporting to Excel/CSV files
  11. Collaboration-like feature: ability to send log messages to gRPC/WCF service and/or between data providers

Main interaction UI:

  • Ribbon area: Log files operations (open) and tools (search/combine/Compare)
  • Messages area: File system UI and Main Log viewer area Main screen

Usage

Thre are 3 modes of operations:

  • real time log server: a gRPC Windows service that can receive messages from any gRPC client and the Log viewer app can connect to it to show real time logs.
  • real time logs: different implementation tha tcan receive logs in real time (e.g: Windows event log data provider that show event logs as they are created)
  • Offline mode: Parse log files. There are many different implemetations. For a full list: see implementations for common logs files/frameworks.

You can also create your own providers: to implement a new data provider do the following:

  1. Create new cs project and make sure your assembly is named Analogy.LogViewer.*.dll.
  2. reference nuget package Analogy.LogViewer.Interfaces.
  3. implement interface:
    public interface IAnalogyFactory
    {
        Guid FactoryId { get; }
        string Title { get; }
        IEnumerable<IAnalogyChangeLog> ChangeLog { get; }
        IEnumerable<string> Contributors { get; }
        string About { get; }
    }

The FactoryId is the identifier of your provider.

  1. implement interfaces IAnalogyRealTimeDataProvider (for real time messages) or IAnalogyOfflineDataProvider (for existing log files).
  public interface IAnalogyRealTimeDataProvider : IAnalogyDataProvider
  {
    event EventHandler<AnalogyDataSourceDisconnectedArgs> OnDisconnected;
    event EventHandler<AnalogyLogMessageArgs> OnMessageReady;
    event EventHandler<AnalogyLogMessagesArgs> OnManyMessagesReady;
    IAnalogyOfflineDataProvider FileOperationsHandler { get; }
    Task<bool> CanStartReceiving();
    void StartReceiving();
    void StopReceiving();
    bool IsConnected { get; }
  }
  public interface IAnalogyOfflineDataProvider : IAnalogyDataProvider
  {
    bool DisableFilePoolingOption { get; }
    bool CanSaveToLogFile { get; }
    string FileOpenDialogFilters { get; }
    string FileSaveDialogFilters { get; }
    IEnumerable<string> SupportFormats { get; }
    string InitialFolderFullPath { get; }
    Task<IEnumerable<AnalogyLogMessage>> Process(
      string fileName,
      CancellationToken token,
      ILogMessageCreatedHandler messagesHandler);
    IEnumerable<FileInfo> GetSupportedFiles(DirectoryInfo dirInfo, bool recursiveLoad);
    Task SaveAsync(List<AnalogyLogMessage> messages, string fileName);
    bool CanOpenFile(string fileName);
    bool CanOpenAllFiles(IEnumerable<string> fileNames);
  }
  1. Implement the container for those interfaces IAnalogyDataProvidersFactory (make sure FactoryId is the same one you created at step 2):
    public interface IAnalogyDataProvidersFactory
    {
        /// <summary>
        /// the factory id which this Data providers factory belongs to
        /// </summary>
        Guid FactoryId { get; }
        string Title { get; }
        IEnumerable<IAnalogyDataProvider> DataProviders { get; }
    }

you can implement additional interfaces:

  • IAnalogyDataProviderSettings - add ability to create use control to load in the application user settings. You can create a specific UI to change specific settings for your provider. this interface comes from nuget package Analogy.DataProviders.Extensions.
  • IAnalogyCustomActionsFactory - custom action to add to the UI
  • IAnalogyShareableFactory - add ability to send log messages from one provider to another

Project Analogy.LogViewer.Example has concrete example.

  1. Put your dll at the same folder as the application. You can download latest version

Logs Analysis and Visualizers

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. Plots Screen

  • Pie Charts: shows pie charts per source/module/log level. Pie Charts

  • Json Visualizer: Json Visualizer

Issues

  • Windows 10 blocks Zip files by default. Make sure to unblock them before unzipping. How to unblocked.

Contact

Owner