-
Notifications
You must be signed in to change notification settings - Fork 38
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
tailview cannot detect my log formmat #242
Comments
@navid-dada At the moment, Tailviewer looks for a few hardcoded keywords to guess the log level of a column, [INF] unfortunately happens to not be one of them. In the long run, I've planned to allow users to configure which keywords to look for, but this hasn't even begun. In the short run, I'll familiarize myself with the serilog text output format and see if I can add support for it. It doesn't look particularly complicated so you can expect to hear back from me with a solution within a week. Hope this helps :) |
…tructure #242 A text log file will use the ITextLogFileParserPlugin, once the log file's format is established, to parse both timestamps and log levels. This will allow for greater customization in the future, compared to now.
sounds great. If you think I can help you with this feature please let me know and guide me about contribution rules and steps. |
Help is always welcome. I do have a light contribution guide, but unfortunately no particular guide to really help you start developing for Tailviewer (yet). At the moment I'm developing a proof of concept to see if my idea of solving this actually works. I envision the following:
If this works as I envision it (and matching can occur relatively fast enough), then Tailviewer should be able to automatically figure out which type of log file was opened and the only thing a user needed to provide was the format string used. In the end, I value all types of contributions, be it in the form of critique of concept, implementation, testing, writing code, etc...´ |
@navid-dada It took a bit longer than expected, but I've now reached a point where Tailviewer is able to parse and interpret custom serilog files. The workflow is as follows:
Log file display: With current implementation, Tailviewer is able to not only interpret the level but also the timestamp of serilog files, allowing your to merge them together (via drag'n drop in the data sources panel): Tailviewer will automatically sort the entries by timestamp in ascending order. I still have some cleaning up to do, fix up the UI and ensure that you don't have to restart Tailviewer upon changing those custom formats in the settings dialog (you may have to at this time), but in the meantime feel free to try out this build: https://ci.appveyor.com/project/Kittyfisto/tailviewer/builds/35372919/artifacts I will post further updates once cleanup is complete and when this feature is finally released. edit |
…iting & parsing #242 (#243) - `TextLogFile` requires an `ILogFileFormatMatcher` to establish the log file's format - `TextLogFile` makes use of an `ITextLogFileParserPlugin` to parse both timestamps and log levels - Plugins may implement `ITextLogFileParserPlugin` and `ITextLogFileParser` to customize parsing attributes from the log file - TextLogFile will revise its log file format detection until 512 bytes have been read - Introduced LogFileProperties.FormatDetectionCertainty: It'll be None / Uncertain until the format is "locked" in and won't change anymore - Add Serilog plugin to tailviewer to allow parsing of custom (text) log file formats - Implement partial parsing of serilog format strings such as `{Timestamp:yyyy-MM-dd HH:mm:ss.fff K} [{Level:u3}] {Message}` - Allow users to specify their own custom formats in the UI
Available with v0.9.3.889. |
I have a log file which is written with this format (serilog format) :
"[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj} source:{SourceContext}{NewLine}{Exception}"
those are like this:
2020-09-13 00:00:12.207 +04:30 [INF] Fetch modification job triggered at 9/13/2020 12:00:12 AM!!!
2020-09-13 00:00:13.046 +04:30 [INF] 1 modified account received for date 1399/06/23
2020-09-13 00:00:28.524 +04:30 [INF] Personage modification job triggered at 9/13/2020 12:00:28 AM!!!
2020-09-13 00:00:28.527 +04:30 [INF] 1 items are in queue to process
2020-09-13 00:00:34.402 +04:30 [INF] User with NationalCode YXZ-OPRRTTT-1 was not in system and account hasbeen created with personage Id 603860
2020-09-13 00:00:37.300 +04:30 [INF] User created for Personage Id 603860 and sms has been sent to 0910XXXXXXX
2020-09-13 00:00:38.398 +04:30 [INF] Customer Modified in personage service with NationalCode YXZ-OPRRTTT-1 and PersonageId 603860
2020-09-13 00:01:08.396 +04:30 [INF] Personage modification job triggered at 9/13/2020 12:01:08 AM!!!
2020-09-13 00:01:08.399 +04:30 [INF] 0 items are in queue to process
2020-09-13 00:01:38.402 +04:30 [INF] Personage modification job triggered at 9/13/2020 12:01:38 AM!!!
2020-09-13 00:01:38.405 +04:30 [INF] 0 items are in queue to process
tailview cannot detect any log level of any entry itself and also there is no way to define my log format to colorize and columnize it by tailview.
this is my tailview output view:
The text was updated successfully, but these errors were encountered: