Skip to content

danw25/Analogy.LogViewer

 
 

Repository files navigation

Analogy Log Viewer

Gitter Build Status Issues License Latest Release Commits Since Latest Release

Content

General

Usage and how to create custom data providers

Logs Analysis and Visualizers

Dependencies and Build

Issues

Contact

General

Analogy Log Viewer is multi purpose Log Viewer for Windows Operating systems with support for most log frameworks log files (serilog, plain text, and others).

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

While there already some implementations for common logs files/frameworks, the primary usage of this application is to implement your own data providers of logs for your own business domain by implementing few interfaces

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

Dependencies & Build

  • Main Application UI is complied to .Net Framework 4.7.2 and to .Net Core 3.1. The projects targets .Net Framework 4.7.2/Core 3.0 . The supported version of Visual studio for this framework is Visual studio 2017 (or above). After successfull build any custom data source assemblies should be placed at the same folder as the executable (Analogy.exe) with the folowing pattern Analogy.LogViewer.*.dll
  • Analogy Interfaces assembly is complied to .Net Standard 2.0.

Detailed Documentation will be added to the Wiki page.

  • DevExpress User Controls: in order to compile this code DevExpress assemblies are required (winforms package only). View list of needed DLLs.

Issues

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

Contact

Owner

About

Analogy Log Viewer Application: A customizable Log Viewer for most common logs

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%