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://www.stefanrufer.ch/snipsnap/space/Virtual+Brain/Java/...</a><p>There'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&view=markup" rel="nofollow">http://svn.apache.org/viewvc/logging/log4j/trunk/src/main/ja...</a>
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?