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.

StructuredLogViewer fails to load large log files

See original GitHub issue

I have a build which produces 1.5GB log file with StructuredLog logger. When trying to load it to the viewer, I get OutOfMemoryException:

System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.Text.StringBuilder.ToString() at System.Xml.XmlTextReaderImpl.FinishPartialValue() at System.Xml.XmlTextReaderImpl.get_Value() at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r) at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o) at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options) at Microsoft.Build.Logging.StructuredLogger.XmlLogReader.ReadFromXml(String xmlFilePath, Action1 statusUpdate) in C:\MSBuildStructuredLog\src\StructuredLogger\Serialization\XmlLogReader.cs:line 22

This can be easily fixed by unchecking ‘Prefer 32bit’ option in StructuredLogViewer project build settings, to allow the 64bit JIT for AnyCPU configuration.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
KirillOsenkovcommented, Jun 8, 2016

I need a fast and compact binary serialization format. XML was good for a prototype, but for large projects such as yours it is wasteful and inefficient.

I’ll need to look into Protobuf.Net, Microsoft Bond or just roll a custom binary serialization format for the log files in addition to XML.

And yes, setting Prefer 32 bit to false is a cheaper workaround which I shall apply as well.

0reactions
KirillOsenkovcommented, Jun 15, 2016

Hi @imag0r and @0x53A. I’ve just published a new version that supports a compact binary log format: *.buildlog. When passing the log file name to MSBuild, use the .buildlog extension instead of .xml. The UI will now default to .buildlog.

I’ll be closing this issue but let me know if there’s anything else I can do to improve it.

I’d be curious to the numbers you get on the log file size for your large builds. How much better is it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Avoid loading whole log files into memory · Issue #21
The first solution i've recommended is to use a daily log system to avoid loading a big log files (I don't know why...
Read more >
How to open the tail of 8 GB log files using Notepad++ in ...
Install 7-Zip. ... Right click the giant log file. ... Open those files in Notepad++ or whatever you use to read files.
Read more >
Software for opening large files (.txt .log files)
I am trying to open large files such as .log or .txt or even source files(range from 40 MB to 5 GB or...
Read more >
VSCode slow to open and highlight large log files
I use VSCode to open large log files with the log highlighter syntax. These log files are very large, often a couple hundred...
Read more >
MSBuild Structured Log Viewer
Viewer Features​​ The MSBuild Structured Log Viewer can build projects and solutions or open existing log files: Leverage the source code of projects...
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