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.

Somehow reduce the number of log files created by third party libraries

See original GitHub issue

@john-science Did some cool work to make our logging stuff implicitly rub off on TPLs, but an unfortunate side effect of this is that we get lots of empty log files, which I assume are being created when the library instantiates its logging object. Would it be possible to either automagically clean these up, or perhaps even lazily create the file on first write? something like that. Not super high priority, but would be really nice.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jakehadercommented, Sep 2, 2021

I believe so! I haven’t seen as many log files around with the changes, but I can reopen if I see them again.

1reaction
john-sciencecommented, Aug 18, 2021

@youngmit Sure thing!

The obvious solution is:

Delete the empty log file when we do “concat logs” at the end of a run. Easy.

Since only child processes create log files, I think modifying the “concat logs” functionality would be safe and complete.

Another option would be to:

Start child loggers without any handlers, and only add a FileHandler the first time someone calls .log().

The second solution feels more elegant, it is certainly more Pythonic. But I feel like the first solution leaves the code in a much more predictable state at all times.

Maybe I’ll do both! Let me play with it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reduce exported symbols of a third party library - Stack Overflow
I tried to use objcopy --prefix-symbols abc_ libabc.so but somehow it did not help, now the crash happens at abc_png_destroy_write_struct . c++ ...
Read more >
Seven Best Practices for Keeping Sensitive Data Out of Logs
Log data is often consolidated to a central system, sometimes operated by a third party. The security posture and safeguards of your logging ......
Read more >
Why db2 was hung while waiting for log files to be archived to ...
Occasionally you may see DB2 hung and it may be because of a problem in the third party vendor used to archive db2...
Read more >
.NET Logging: Best Practices for your .NET Application ...
For . NET Core 3.1, Microsoft has developed their own logging libraries, which are installed by default in our application.
Read more >
Logging Best Practices: The 13 You Should Know - DataSet
Never, ever use printf or write your log entries to files by yourself, or handle log rotation by yourself. Please do your ops...
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