Новый подход к просмотру логов

Glogg

Glogg is another free log file viewer for PC. The main advantage of this software is that it features Live updation of search results. So, if you are using log file to analyze specific events, then as new events get added to the log file, it will highlight those in the search results. You can specify polling period at which it should refresh the search results.

In terms of interface, there are some pretty good features that this log analyzer has. The main interface is divided into 2 parts. The top part of the interface is to view the log file. The bottom part is to see the search results. So, if you search for anything in your log file, all the rows that match search results are shown in the bottom part. This makes it very easy to see the search results. It does not give a direct option to export the search results, but you can select all the rows of the search results, copy them, and then paste them anywhere.

In terms of search, it lets you do three types of searches. All the searches can be case sensitive or case insensitive:

  • Fixed Strings: This option lets you do an exact match search.
  • Wildcards: This is a unique option in this log viewer that you can perform searches using wildcards as well. For example, if you want to search for “machine”, you can give search term as “mac*ine”. I am not sure what are the other wildcards that it supports.
  • Regular Expressions: As is the case with most of the log viewers, you can do regular expression based search in this as well.

There is one more feature of this software that I really like, and that is option to highlight rows that meet a filter criteria with a specific foreground and background color. For this, go to Tools menu, and choose Filters. There you can add a filter, specify pattern, and then specify foreground and background colors. All the rows that match that filter criteria will be highlighted accordingly. You can add as many filters as you want, and specify separate colors for each filter, and then rows would be highlighted accordingly.

The remaining options in this software include, option to see line numbers, option to see font and font size, and option to set encoding.

Конфигурация

Я старался сделать конфигурацию как можно проще, чтобы всё работало из коробки. Если попросить пользователя задать формат лога, то большинство просто закроют приложение и пойдут смотреть по старинке. Поэтому формат лога распознаётся автоматически. Конечно, это работает не всегда и часто не точно. Для таких случаев можно лога вручную в файле конфигурации. Можно использовать паттерны log4j, logback или просто регексп. Если ваш лог не распознался, но вам кажется что должен — создайте issue на GitHub, этим вы поможете проекту.

Самая нужная настройка — список видимых файлов. По умолчанию доступны все файлы с расширением «.log» и видна вся структура каталогов, но это не очень хорошо с точки зрения секьюрити. В конфигурационном файле можно ограничить видимость файлов с помощью списка паттернов типа такого:

Пользователю будут доступны только .log файлы в директории /opt/my-app/logs и любые файлы в директории ~/work и её поддиректориях.

Более подробная информация в документации на GitHub.

Dynamic Log Viewer

Dynamic Log Viewer, is another log viewer that lets you open large/heavy log files. It is a very fast log viewer in this list. I have tried 1 GB log file in this software and it opened it instantly within 1 second. It displays total number of lines in a log file along with its size on its interface. You can view the number of a particular line by clicking it.

Here are some of the features of this log viewer:

  • It has an Autoscroling feature, which automatically scrolls the loaded log file to bottom. If you don’t want this feature by default, you can lock Autoscrolling.
  • Click Restrict Empty Lines and this free Windows log viewer clears all empty lines from the log file.
  • Print option is also available. You can adjust page setup, page margins (in millimeters), and select page orientation (landscape or portrait) before taking a print out.
  • Coding Standards: This free log file reader supports more than 5 coding standards, which include: ANSI, OEM, UTF-7, UTF-8, etc. You can easily convert log file from one code to another code.
  • Dynamic Log viewer supports three languages: English, Czech, and Slovak.
  • Its other features include go to a line, full screen mode, etc.
  • You can define length of lines that you want to see, and the longer lines will be wrapped.

The biggest downside of this software is its search feature. You can only do an exact match search, and choose direction for it (forward or backwards). There is no option to do any regex search. Also, search results can’t be exported.

Universal Viewer

Universal Viewer is another log file viewer that can be used for viewing heavy log files. I don’t know the maximum size of a log file that it supports, but I have opened 1 GB log file in this free log viewer and it opened it in less than 1 second. This shows how fast this software is. One of the advantages of this software is that you can open all log files one by one by clicking previous file or next file buttons if all log files are located in the same folder. It does not lets you edit a log file but a lot more features are available in this freeware.

To analyze a log file, search is a very important tool. You can find a text or a string in this software with the help of Find tool available. There are different filters available in the software which you can use to refine your search. Following are these filters that are beneficial for getting more relevant search results:

  • Case Sensitive: Like other log file readers in this list, case sensitive feature is also same for this software.
  • Whole Words Only: Enable this filter, this software considers the typed letters as a complete word and searches for that.
  • Regular Expressions: Log files contain many regular expressions. This tool is designed to search such type of expressions.
  • Direction: This feature lets you start your search either from top to bottom or from bottom to top.
  • Origin: This type of search mode starts searching texts either from the position where you have placed cursor in a log file or from the beginning.

Have a look at some of its general features:

  • You can rename any log file.
  • On pressing F5 key, you can copy the entire file to any folder on your PC.
  • You can also move a log file to any folder on your system.
  • Print feature is available in this freeware. You can preview a file before taking its print-out.
  • It can also display non-printable characters.
  • You can copy a selected string or whole log file and paste it into a new file.
  • It lets you create a link to any log file for easy access.
  • It supports more than 5 viewing modes for a file, which includes: Text, Binary, Hexadecimal, RTF, etc.

This is a very good log file viewer in terms of speed, as it saves your time by opening large log files quickly. Besides this, it has a biggest downfall. It highlights only one searched text at a time.

GamutLogViewer

GamutLogViewer is quite a feature rich log viewer for Windows. It comes in both free as well as paid version. Even though many of the features are disabled in free version, still its free version has some features that make it stand apart from the rest.

The feature that I like most in this log viewer is that you can specify your own log parser in that. What that means is that if you have a log file that have long lines of text, but you want to divide that text in form of columns, then you can define that pattern in this software. It will then use that pattern to display your log file in form of nice table with rows and columns. And it makes it very easy to define the pattern. You start by choosing a row which has data for all the columns that you want, then break that row into separate columns, then specify the column separators, and you are done. You can also save the log parser that you have defined so that you can use that in future for other similar log files. And you can define multiple log parsers and pick from among them whenever you try to open a log file.

In terms of search, it provides both normal search as well as regex search. However, regex search is available in paid version only.

In the free version, it provides option to highlight rows with different colors depending on the filters that you have specified. For example, you can specify that all the rows that have “Policy” word should be highlighted with Red color, the ones that have word “reset” should be highlighted with Green color, and so on. You can specify multiple filters together to highlight rows with different colors.

Some other features that are available on the interface of this free log viewer are:

  • Its main toolbar has icons for Error, Info, Message, etc. that let you quickly jump to corresponding row in your log file.
  • You can wrap text.
  • Bookmark lines
  • Zoom in and out
  • Option to add column level filters
  • Option to undo filters
  • It can open multiple log files together on its tabbed interface.
  • There are tons of encoding formats it supports, including,  OEM United states – IBM437, Thai (Windows) – Windows-874, Unicode-utf-16, Baltic (Windows) – Windows-1257, Chinese Traditional (CNS)-x-Chinese-CNS.

The paid version of this software is even more feature rich, and comes with advanced features like, merge multiple log files into one, split log file into multiple files, save color filters, etc.

So, if you are not looking for advanced search options for your log file, then this is one of the best free log file viewer.

Bare Tail

Bare Tail is another free log viewer software in this segment. This software is designed to open heavy log files. I do not know exactly what is the maximum size limit to open a log file for this software, but I have opened log files of size as large as 1GB and it opened them quickly within a second. Like some of the log file viewer software in this list, it also supports to open multiple log files in multiple tabs.

It is actually a real-time log file viewer. It couples that with a tail feature. So, you can monitor the end of a Live updating log file. Not only that, it can actually Live monitor multiple log files in its multiple tabs. So, if you have multiple log files for different types of events, and you want to keep a tab on them, then this tool is good.

If I talk about search tool, it features a highlighting tool. Using this tool, you can search many different text with different colors. It also lets you change foreground and background colors for your searches. This is an advanced search tool which also lets you modify your search by applying filters.

  • Ignore Case: You can make your search Case Sensitive by disabling Ignore Case filter.
  • Invert Match: This is a very useful filter in this software. If you enable this filter, the software highlights the entire log file, except searched text.

Save to Registry and Load from Registry features are also available in this software, but these did not work while I was testing it.

Apart from this, it supports many coding standards. Some of these include: ASCII, ANSI, etc.

Some other features of this log viewer are:

  • You can configure line size
  • You can configure tab size
  • It can open log files over a network.
  • Its a portable log file viewer, so just double click on the executable and start using it. No installation required.

Even though this log viewer has some pretty good features, but a big limitation I found is that it does not support Regular Expressions for search.

Какую задачу мы решали?

Можно долго рассуждать о важности серверных логов и привести много примеров ситуаций, в которых они жизненно необходимы, но так как речь пойдет именно о сторонней системе и ее особенностях, то выделим ряд важных моментов:

  • Удобно, когда все логи хранятся в одном месте.

  • Круто, когда есть отчеты и возможность автоматически их проанализировать.

  • Полезно, когда логи можно посмотреть даже при “упавшем” сервере или после того как злоумышленник “прибрался” за собой.

  • Бесценно, когда о возникшей ошибке в логах будет оповещение.

Сформулировали задачу так: 

“Подобрать бесплатное open source решение для сбора и анализа логов, не перегруженное функционалом, производительное, простое в установке и использовании.”

Фильтрация

Набор фильтров зависит от формата лога. Некоторые фильтры доступны всегда, например фильтр по подстроке, а некоторые появляются если в логе присутствует поле определённого типа. Это позволяет создавать специализированные фильтры для некоторых типов полей. Например, если в логе есть поле severity, то в верхней панельке появится такой UI компонент:

Очень удобно добавлять фильтры из контекстного меню. Можно выделить текст, кликнуть правой кнопкой мыши и выбрать «Не показывать записи с таким текстом». На панельку с фильтрами автоматически добавится фильтр по тексту, скрывающий записи с таким текстом. Помогает когда лог завален однообразными записями, не интересными в данный момент.

Можно кликнуть на запись и выбрать «Скрыть последующие записи» или «Скрыть предыдущие записи», чтобы работать только с определённой частью лога. Скрытие происходит добавлением фильтра по дате.

Для сложных случаев можно задать фильтр с условием написанным на JavaScript. Такой фильтр представляет из себя функцию принимающую одну записи и возвращающую true или false.

При изменении фильтров, просмотрщик старается максимально сохранить позицию в логе. Если есть выделенная запись, то изменение фильтров не изменит её положения на экране, а записи вокруг пропадут или появятся. Пользователь может задать фильтр, чтобы были видны только ошибки, найти подозрительную ошибку, затем убрать фильтр и смотреть что происходило вокруг этой ошибки.

Состояние панели фильтров отображается в параметрах URL, чтобы можно было добавить в закладки браузера текущую конфигурацию.

File Peeker

File Peeker is a free lightweight log file reader which lets you open large log files quickly. The main advantage of this log file viewer is that it lets you specify the part of the log files that you want to view. For example, you can specify that you want to start viewing the log file starting 22,000 bytes, and view 10,000 bytes from there on. You can also specify this in percentage, that where do you want to start viewing your log file from, and then what percentage of it you want to view. I wish it had option to specify this information in terms of number of lines as well, but that feature is missing.

So, if you have a very large log file, but you know which part of it you want to view, then this freeware log viewer will come very handy.

It does provide search as well, but the search feature is pretty basic. You can only search for an exact match string, and choose to perform the search case sensitive or non-case sensitive. It does not have any option to perform regex based search. Also, when you search for a string, it does not highlight all the instances of that string, but only the first instance is highlighted. You have to press Search button again to go to the next search result.

A good feature of search is that you can choose to search the entire log file, or only the part of the log file that you have chosen to view.

So, to summarize, if you want a log viewer that lets you view a specific part of a log file, then File Peeker is a good software for that. But if you want one with powerful search options, then you need to use some other log viewer from this list.

General

Analogy Log Viewer is multi purpose Log Viewer for Windows Operating systems.

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

The application supports the followings data providers:

  1. Common logs frameworks like: Serilog, NLog, Log4Net, Microsoft Logging.

  2. Generic file types: Json Parser and XML parser.

  3. Real time streaming from the following languages: C#, C++, Python and JAVA using gRPC log Server and client.

  4. Custom providers. Create specific parsers for specific applications.

Sonar Log Viewer (SLV)

Sonar Log Viewer (SLV) — программа для просмотра эхограмм для любых эхолотов имеющих слот для SD/MMC карточки.

  • Поддерживает эхограммы StructureScan
  • Поддерживает SL2 файлы
  • Позволяет выводить информацию в формате Exel
  • Увеличение масштаба изображения (zoom), чувствительность,
  • Цветная интерпретация сигналов эхолота может быть определенна пользователем
  • Динамически изменяемое окно
  • Работает как Windows Multimedia Player (кнопки вперед, назад, быстрая перемотка, пауза и т.д.)
  • Курсор мыши показывает GPS координаты, глубину, температуру и прочее
  • Поддержка просмотра нескольких каналов с синхронизацией

Пример эхограммы ловли сома на квок

Вы можете скачать эхограмму ловли сома (38 Mб) и просмотреть ее с помощью Sonar Log Viewer. Запись любезно предоставлена Олегом Омельянчуком и сделана картплоттером/эхолотом Lowrance HDS 5. Ниже представлены — скриншоты этой эхограммы с расшифровкой.

LogViewer

LogViewer is another simple Log file viewer for Windows. It has a bit confusing interface. When you open it, you will see that the entire interface is blank, there is no menu or option at all. You will need to right click on its interface to see all the options it has. Start by choosing Open option to open any log file.

When a log file is opened, you can just scroll to see on its interface. You can change font size by again using the right click menu.

Now, there are a few good options that this software has, but none of those worked for me, and I am not really sure if I missed something. I encourage you to try them at your end.

  • Hide Rows feature lets you hide rows based on pattern you have specified. You can specify multiple patterns and all the rows that meet those patterns will be hidden.
  • You can colorize rows that match the specified pattern. You can specify multiple patterns, and different color with each pattern.
  • You can also sanitize lines, so that unwanted part from the lines is removed. Again, you need to specify patterns for that.

These are actually pretty powerful features, but none of them worked for me. If these worked, I would have placed this software pretty high up in the list.

This software also comes with a TCP port listener, that can listen to ports and create log.

Usage

Log Viewer toolbar

All basic functions of the ORF Log Viewer can be accessed by clicking various icons of the toolbar in the upper-right corner. These are:

  • Load/Refresh Log filesLoad the log files according to your settings.
  • Open log fileOpen an individual .log file.
  • Search logsQuick search in the events currently loaded.
  • Edit or create filterCreate a filtered view of the events.
  • Send IP or email to listSend an IP or email address to the manual list of the Administration Tool (see remote control).

Viewing events

Double click on the event row or hit Enter to display the event in the Log Event Properties dialog. Click the Next and Previous buttons in the dialog to navigate between events or click Copy to Clipboard to copy the event properties to the clipboard.

If you click the Explain button in the Event Properties dialog, the Log Viewer will try to query our online knowledge base and fetch detailed information about the given event.

Selecting and copying data

Copy contents of a single cell to the clipboard by either pressing CTRL-C or right click the cell and selecting Copy Cell.

To copy the active event, press CTRL-R or right click on the row and select Copy Selected Events. You can copy multiple events using this option. To select multiple events, hold the SHIFT key down and select the event range to be copied either by the mouse or by the cursor control keys. Non-continuous event ranges can be selected by holding the CTRL key and selecting the event rows by the mouse.

Sending items to the ORF Administration Tool

Right click the selected event and select the data that you want to send to the ORF Administration Tool. See the Remote Control section for more information.

Отображение лога

Чтобы легче различать границы одной записи, запись под курсором подсвечивается прямоугольником; поле severity подсвечивается различными цветами в зависимости от значения, парные скобки подсвечиваются когда наводишь курсор на одну из них.

Обратите внимание на стектрейс эксепшена, показаны только самые интересные строки, остальные сфолжены под «+» и «…» , интересными строками считаются классы из пакетов принадлежащий главному приложению, соседние с ними, и первая строка. Пакеты главного приложения задаются в конфигурации

В таком виде стектрейс занимает намного меньше места на экране и его удобней смотреть. Возможно такая идея понравится разработчикам Java IDE.

Имя логгера тоже сокращено: «~.SecurityManager». Показывается только имя класса, а пакет сворачивается в «~».

Фолдинг влияет только на отображение, поиск работает по оригинальному тексту. Если совпадение найдётся в сокращённой части текста, то эта часть текста автоматически появится. Также, если пользователь выделит текст и нажмёт Ctrl+C, в буфер скопируется исходный текст, без всяких сокращений.

Архитектура позволяет легко навешивать на текст подсветку или всплывающие подсказки, благодаря этому, сделаны разные приятные мелочи типа показа даты в человеческом формате, если она напечатана в виде числа:

Move Event Viewer log files to another location

Important

This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, see How to back up and restore the registry in Windows.

To move Event Viewer log files to another location on the hard disk, follow these steps:

  1. Click Start, and then click Run.

  2. In the Open box, type regedit, and then click OK.

  3. Locate and click the registry key: .

  4. Click the subkey that represents the event log that you want to move, for example, click Application.

  5. In the right pane, double-click File.

  6. Type the complete path to the new location (including the log file name) in the Value data box, and then click OK.

    For example, if you want to move the application log (Appevent.evt) to the Eventlogs folder on the E drive, type e:\eventlogs\appevent.evt.

  7. Repeat steps 4 through 6 for each log file that you want to move.

  8. Click Exit on the Registry menu.

  9. Restart the computer.

Эмуляторы

Эмуляторы Lowrance — загружаемые программные приложения, которые моделируют на Вашем компьютере работу фактического прибора. Вы можете установить эмулятор на свой компьютер и программа создаcт виртуальный эхолот или GPS, который в точности повторяет внешний вид и работу прибора! Демонстрационные карты Navionics включены в эмуляторы продуктов, у которых есть возможность чтения карты памяти. Эти эмуляторы позволяют Вам:

  • попробовать эхолот, эхолот-навигатор Lowrance в работе, не покупая его
  • спокойно, в домашней обстановке, разобраться во всех функциях сонара и не тратить драгоценное время на обучение на воде
  • экспериментировать с дополнительными функциями и установками для максимально точной настройки под собственные нужды
  • детально осматривать сохраненные маршруты ваших путешествий, исследуя пути и рельеф дна в излюбленных местах рыбалки не расходуя топливо для лодки

Эмуляторы серий Mark, Elite выделены жирным.

  • Elite-5 Emulator |Загрузить (17 MB)
  • Elite-5x Emulator | Загрузить (15 MB)
  • Mark-5x Emulator | Загрузить (15 MB)
  • Lowrance AirMap 2000C | Загрузить (12.6 MB)
  • Lowrance LCX-25C | Загрузить (14.6 MB)
  • Lowrance LCX-112C | Загрузить (17.3 МБ)
  • Lowrance LMS-520C | Загрузить (17.3 МБ)
  • Lowrance LMS-522C iGPS | Загрузить (17.3 МБ)
  • Lowrance LMS-525C DF | Загрузить (17.3 МБ)
  • Lowrance LMS-527C DF iGPS | Загрузить (17.3 МБ)
  • Lowrance X125 | Загрузить (5.3 МБ)
  • Lowrance X126DF | Загрузить (5.3 МБ)
  • Lowrance X510C | Загрузить (5 МБ)
  • Lowrance X515C DF | Загрузить (4.9 МБ)
  • Lowrance X87 | Загрузить (3.3 МБ)
  • Lowrance X88DF | Загрузить (3.3 МБ)
  • Lowrance iFINDER H2O | Загрузить (12.5 МБ)
  • Lowrance iFINDER Pro | Загрузить (12.8 МБ)

Установка эмулятора предельно проста. Кликните на кнопку «загрузить», напротив интересующего вас прибора. В появившемся меню выберите кнопку «сохранить», затем укажите папку на вашем компьютере в которую загрузится эмулятор. После завершения загрузки запустите установочную программу и следуйте инструкциям (достаточно просто нажимать кнопку «Next»). По завершении установки в меню «Пуск/Программы» (Start/Programs) появиться новый раздел, в котором и будет эмулятор.Выключение программы происходит как и в настоящем приборе, а именно — необходимо нажать и удерживать кнопку «PWR». Для удаления программы достаточно зайти в «Панель управления» в раздел «Установка и удаление программ», найти там программу, которую вы хотите удалить и нажать на кнопку «Заменить/Удалить».

Log Expert

Log Expert is a lightweight log viewer for Windows. This log file viewer is suitable for small log files. I was able to open a 300 MB log file in it, but a larger file didn’t open. It can open multiple log files in separate tabs. If you reopen the software, all tabs will be restored. The best part of this freeware is that you can edit a log file and save it on your PC. Like some other log viewer software in this list, it also displays the list of recently opened files, which provides you quick access. It opens a log file and displays its line numbers.

You can add bookmarks to any row and switch among added bookmarks easily. If you want to view all your added bookmarks, simply press F6 key. This log analyzer will open a window that contains all your added bookmarks. It also lets you export all bookmarks on your PC.

Filters: Use filters to modify your searches. You can make your searches case sensitive, invert your matches, restrict columns, open filtered results in new tabs, etc.

Search Tool: You can start your search either from selected text or from top. Besides this, directional search is also available in this software, which lets you start search in forward or backward direction. It highlights all searched text within the entire log file with yellow color. This lets you recognize them easily. After the completion of a search, it shows all the lines that contain searched text along with their line numbers at its bottom part.

Encoding: It supports 5 types of encoding, which include: ASCII, Windows-1252, UTF8, etc.

Plotting

Along with custom Data Providers you can create Plots of arbitrary data by implementing the 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

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 that can 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: for common logs files/frameworks.

If you need you can 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. inherite 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.

  1. create DataProvidersFactory class that contains all your providers (real time or offline):
    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() };
    }
  1. To implement offline (log file) Parser inherite 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);
  1. To implement real time streaming Parser inherite 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.

  1. Put your dll at the same folder as the application. You can download latest version
Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector