question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support JSON styled log files

See original GitHub issue

I’m working on log files that are structured as JSON objects, one per line, e.g.

{"time":"27-01-2022 16:41:23.382","level":"CRITICAL","logger":"MyApp","callstack":"TiltSensorCalibrationApp.TiltSensorCalibrationApp","message":"Error using (line 66)\nInput Parsing Error\n\nCaused by:\n    Error using jsondecode\n    JSON syntax error at line 1, column 1 (character 1): expected value but found 'asdf'."}
{"time":"27-01-2022 16:44:03.062","level":"CRITICAL","logger":"MyApp","callstack":"TiltSensorCalibrationApp.TiltSensorCalibrationApp","message":"Error using (line 66)\nInput Parsing Error\n\nCaused by:\n    Error using jsondecode\n    JSON syntax error at line 1, column 1 (character 1): expected value but found 'asdf'."}

It might be interpreted as tabular data (as long as the format remains the same of course). Do you see any chance to support parsing that format?

Thank you very much!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
emilastcommented, May 27, 2022

@emilast In structured logging, the logs are meant for ingestion by automated services and so are hard to read by humans - hence the ugly json shown in the OP’s example. But it’s nonetheless useful to consult such logs during development anyway - so I also was hoping for this feature.

Are you aware of a jsongrid tool that can be used inside vscode (or that an extension can “wrap” to provide this functionality)? I’m asking because you know way more about this than the rest of us (since you maintain a logging extension 😄).

No, I’m afraid I don’t.

BTW, I use the extension for other purposes too, and it’s great - thanks for making it!

Thanks 😊

0reactions
jankapcommented, May 24, 2022

@jankap Did you find another way?

No, not yet unfortunately.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get Log Output in JSON - Baeldung
Learn how output JSON using the two most popular logging libraries, Jog4j2 and Logback.
Read more >
JSON File logging driver - Docker Documentation
The json-file logging driver uses file-based storage. These files are designed to be exclusively accessed by the Docker daemon.
Read more >
Service logging in JSON with Bunyan - Node.js
Bunyan is a Node.js module for logging in JSON and a bunyan CLI tool to view those logs. ... Bunyan is log4j-like: create...
Read more >
JSON Well Log Format
A JSON Well Log file consists of one or more log sets each containing a log header, curve definitions and the corresponding measurement...
Read more >
[Pimp my Log] Customization
The current parsed log file ID is defined as a CSS classname so you can customize distinct design according to each log file....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found