Path: csiph.com!aioe.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=c3=b8j?= Newsgroups: comp.lang.java.programmer Subject: Re: Not closing connections and statements Date: Sat, 13 Aug 2016 10:04:11 -0400 Organization: Aioe.org NNTP Server Lines: 27 Message-ID: References: <87shuakxjq.fsf@Equus.decebal.nl> <87k2fllkjf.fsf@Equus.decebal.nl> NNTP-Posting-Host: 7SK6yTFfqwlIPNBLl3l7Qg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:35304 On 8/13/2016 2:47 AM, Marcel Mueller wrote: > But as already mentioned, log4j might be a good advice. > But from my experience any logging to a database is at most the > second-best solution. In critical situations it might not be reliable > enough and you loose exactly the log records that you really need. Of > course, it depends on your use case. Logging only once an hour might not > fall into this category. Very relevant point. But one of the possibilities with a highly configurable logging framework is that it is possible to log all the usual crap to a DB and log major problems with the logging to a flat file. > The library also handles switching the logs from time to time to limit > their size as well as the cleanup of old logs. So no disk will get full > after years, because no one cleaned up the logs. In contrast to log4j > files will never get renamed because this could confuse concurrently > reading applications or even cause locks (depending on the OS and file > system). Instead we use (partial) time-stamps in the log name, e.g. the > date in yyyymmdd format. I believe that is what log4j RollingFileAppender does as well. Arne