-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Identify columns and levels #349
Comments
Hey @retroflex, sorry for the long delay, I was taking some time off :)
Only programmatically as of right now. Tailviewer natively supports log levels from log4net / log4cpp. Other log levels will have to be extended via plugins. I did one such extension last year where someone had a similar request for another popular .NET logging framework (Serilog). Alternatively, if you're willing to wait for a few months, I should be able to come around to it eventually.
This feature is planned, but not done just yet. This feature is planned for v1.2: https://github.com/Kittyfisto/Tailviewer/projects/6 At the moment, I've helped myself to write a plugins for the log files I work with at work which tabularize the text, before being displayed. If you're interested, I can share the relevant code with you, if you'd like to try the same for you in the meantime. |
@Kittyfisto Thanks for the reply! Regarding levels, I could have a look at a plugin for spdlog. Can you point me in the right direction, like what interface I need to implement? Columns: Sure, I'd like to have a look the code. I guess one can live without columns, but it gives a bit better overview. |
@retroflex Sure, I can help you with that. In order to achieve what you want, you have to do the following two steps:
You can find an implementing for both of these jobs for Serilog here: https://github.com/Kittyfisto/Tailviewer/tree/master/src/Plugins/Tailviewer.Formats.Serilog The workflow of this plugin requires that the user register a particular Serilog format with Tailviewer, which is why this example requires the implementation of three plugin interfaces: ICustomLogFileFormatCreatorPlugin: https://github.com/Kittyfisto/Tailviewer/blob/master/src/Plugins/Tailviewer.Formats.Serilog/SerilogFileFormatCreatorPlugin.cs From the looks of it, spdlog also allows the user to define their pattern, such as ILogFileFormatMatcherPlugin: ILogEntryParserPlugin: https://github.com/Kittyfisto/Tailviewer/blob/master/src/Plugins/Tailviewer.Formats.Serilog/SerilogEntryParserPlugin.cs A good starting point would be to simply copy the Serilog plugin and make modifications based on that. It even comes with a suite of unit tests which should allow you to quickly find out if you're on the right track. You can find an additional article on how to develop plugins here: https://github.com/Kittyfisto/Tailviewer/blob/master/docs/DevelopingPlugins.md Regarding columnization, I'll have to go and dig it up as this plugin isn't part of tailviewer itself. I will contact you with more details. |
Just found your app. Very nice work!!
I tried it with my log file and the time is parsed perfectly but the rest is not. Example of a log line:
[2021-04-09T10:14:12.012Z] [On-prem] [schema_2] [PID=24700] [w3wp] [TID=32888] [service] [critical] [ChildProcess.cpp:312] Process could not be started
My first problem is the levels. I'm using C++ library "spdlog" which is popular. It has these levels:
"trace", "debug", "info", "warning", "error", "critical"
Alternatively these short names:
"T", "D", "I", "W", "E", "C"
Is there any way to map these to the levels in Tailviewer?
My second problem is regarding columns. I think Tailviewer should columnize my file, right? But maybe it needs another format than mine with brackets?
The text was updated successfully, but these errors were encountered: