TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Smarter log handling, the case for opportunistic logging

15 pointsby theotownover 11 years ago

3 comments

bazzarghover 11 years ago
This (logging to a ring buffer) has been done many times - eg <a href="http://www.stefanrufer.ch/snipsnap/space/Virtual+Brain/Java/Debug-Appender" rel="nofollow">http:&#x2F;&#x2F;www.stefanrufer.ch&#x2F;snipsnap&#x2F;space&#x2F;Virtual+Brain&#x2F;Java&#x2F;...</a><p>There&#x27;s even an implementation built right into log4j, 13 years ago, the SMTPAppender: <a href="http://svn.apache.org/viewvc/logging/log4j/trunk/src/main/java/org/apache/log4j/net/SMTPAppender.java?revision=308876&amp;view=markup" rel="nofollow">http:&#x2F;&#x2F;svn.apache.org&#x2F;viewvc&#x2F;logging&#x2F;log4j&#x2F;trunk&#x2F;src&#x2F;main&#x2F;ja...</a>
bmohlenhoffover 11 years ago
So instead of writing stuff out to disk, the idea is to keep everything in memory forever until something bad happens? Like, for instance, your machine runs out of memory because your debug logging consumed all of it.<p>How is that better?
评论 #6927679 未加载
评论 #6927588 未加载
评论 #6927521 未加载
评论 #6933700 未加载
theotownover 11 years ago
Haha, first pull request activated! <a href="https://github.com/shelajev/opportunistic-logger/pull/1" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;shelajev&#x2F;opportunistic-logger&#x2F;pull&#x2F;1</a>