title: PL/SQL Logging - How to control?
body: <p>I am looking to introduce a logging framework into our existing Oracle application to replace the use of DBMS_OUTPUT. </p>
  
  <p>The framework will be used primarly to aid debugging and would detail such things as starting x procedure, details of parameters, ending procedure x etc. It should also have the functionality to be turned on for all or just one program unit, various levels of trace in fact what is pretty much standard logging functionality.</p>
  
  <p>Implementing these requirements should be relatively straightforward, however where I would like your help is how best to turn this functionality off and on. What I am trying to achieve is the smallest possible performance hit when the trace is turned off. Which hopefully should be most of the time!</p>
  
  <p>As the application is using 10g release 2, I initially I liked the look of wrapping the logging mechanism inside conditional compilation so that logging framework is not even visible during normal operation. Unfortunately I have had to grudgingly abandon this idea as most of the application is built using stand-a-lone procedures &amp; functions so turning on a logging functionality could potentially invalidate a lot of code. </p>
  
  <p>I have had look a several existing opensource and other's frameworks\functionality for inspiration: </p>
  
  <p><strong>log4plsql (<a href="http://log4plsql.sourceforge.net/" rel="nofollow noreferrer">http://log4plsql.sourceforge.net/</a>)</strong> </p>
  
  <p>APC's review <a href="http://radiofreetooting.blogspot.com/2005/06/oracle-logging-in-plsql.html" rel="nofollow noreferrer">here</a>  especially under acceptable impact gives me concerns.</p>
  
  <p><strong>OraLog project (<a href="http://oralog.sourceforge.net" rel="nofollow noreferrer">http://oralog.sourceforge.net</a> )</strong></p>
  
  <p>No updates since 2007</p>
  
  <p><strong>PL/VISION</strong> (<a href="http://www.toadworld.com/Downloads/ExclusiveToadWorldSoftware/tabid/78/TID/158/cid/64/Default.aspx" rel="nofollow noreferrer">here</a>)</p>
  
  <p>Looks quite old, no changes since Oracle 8i?</p>
  
  <p><strong>Ask Tom Instrumentation</strong> (<a href="http://asktom.oracle.com/pls/asktom/z?p_url=ASKTOM%2Edownload_file%3Fp_file%3D5466674809774155519&amp;p_cat=instrumentation.zipp_company=822925097021874" rel="nofollow noreferrer">here</a>)</p>
  
  <p><strong>Update 01/04/2014</strong>
  <a href="http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:54174245781686" rel="nofollow noreferrer">Tom Kyte</a> now recommends Tyler Muth's <a href="https://github.com/OraOpenSource/Logger" rel="nofollow noreferrer">Logger</a></p>
  
  <p>I would be really interested to hear your experiences if you have introduced some form of logging into your Oracle application, how you implemented it and especially how you control it.</p>