UNIversal LOGging Package for Oracle PL/SQL. Straightforward, easy to install and easy to use.
There are other full-featured (but sometimes complex or even sluggish) logging tools for PL/SQL around. The main focus of UNILOG lies in its simplicity.
UNILOG was started for educational purposes, but soon became implemented in enterprise applications, running in production for years now. This is why the original author decided it might be useful to others and should be made available to a wider audience as Open Source.
UNILOG is free and Open Source and distributed under the terms of the X/MIT license (http://opensource.org/licenses/MIT); for licensing details see the file LICENSE.
- Change Line No. 19 in
unilog.sql
to put the logging table in your preferred tablespace (default is "TOOLS"). - Run
unilog.sql
against your application's schema (you might consider a separate logging schema but let's keep it simple here). - Start logging from your PL/SQL application, e.g.
unilog.put('Test message');
- Check the contents of the logging table:
select * from UNILOG_MSGS;
Voilá! You're up and logging.
Although "put" handles all possible logging types, there are two extra procedures for the most used cases:
- put_with_errln - Log entry with first line of error stack
- put_with_trace - Log entry with full error stack