title: Define when to flush log entries to database in Enterprise Library 4.1
body: <p>I'm trying to create a custom database trace listener based on the FormattedDatabaseTraceListenerData and I'm having some doubts regarding its performance. What's the best way to cache in-memory logging entries so less transactions/connections to write logging data are made?</p>
  
  <p>I'm using Enterprise Library 4.1.
  I think I have seen this type of caching options somewhere but I lost track of it.</p>
  
  <p>Trace Listener <a href="http://msdn.microsoft.com/en-us/library/microsoft.practices.enterpriselibrary.logging.database.configuration.formatteddatabasetracelistenerdata.aspx" rel="nofollow">MSDN</a></p>