UNIversal LOGging Package for Oracle PL/SQL
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE.md
README.md
unilog.sql

README.md

====== UNILOG

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.

Quick Start

  1. Change Line No. 19 in unilog.sql to put the logging table in your preferred tablespace (default is "TOOLS").
  2. Run unilog.sql against your application's schema (you might consider a separate logging schema but let's keep it simple here).
  3. Start logging from your PL/SQL application, e.g.
unilog.put('Test message'); 
  1. 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