Как то так ...
create or replace package logger as
min_level number := 2;
procedure ins_log(level number, message varchar2);
end;
create or replace package body logger as
procedure ins_log(level number, message varchar2) is
pragma autonomous_transaction;
begin
if level>=min_level then
insert into loggin(ts, msg) values (sysdate, message);
end if;
commit; // autonomous_transaction requires that
end;
end;
РЕДАКТИРОВАТЬ: Добавлено pragma autonomous_transaction;
, спасибо Адам