|
Hi all,
I consider to use Log4plsql (V2.1.1) in a project
where a lot of the code is written in Java, and there is also a lot of PLSQL. I
need to send the logs to certain log files, and it is required that logs from
PLSQL code is same format as logs from Java.
Looking at the Log4plsql code, I believe I can
benefit from using the background processing. However, there are some challenges
;-)
First I need to dispatch the logs to the correct
log file. This should be possible by using the section functionality to
identify log file destination. Basically each PLSQL package will log to a
certain log file, and pushing the package name as section, it should be fairly
easy to configure the hierarchy in Log4J to dispatch logs to the correct
file.
The second challenge is worse. We are a number of
developers who each use our own unix-user and database scheme (user) to run
the application. When logging from one database scheme, the developer expects
the logs to appear in the log files belonging to the corresponding unix user
e.g. located in $HOME/myapp/logs. The Log4plsql package writes logs to pipe and
the background Java logging process receives the logs from this pipe. But the
pipe name is a constant (LOG_PIPE), which means I can only have one
background logging process and it must have write permissions to all the log
directories. I could create a superuser for this purpose and allow this
superuser to write to the developers home directories (or at least their log
directories). The background logging process should then be run by the
superuser. Still it requires the developers to be able to control logging for
their database scheme, which means they must have write access to the
background logging configuration. This is a little cumbersome.
I believe a better approach is to allow the PLSQL
logging to control which pipe to log to. Then I would use one pipe for each
database scheme (say LOG_PIPE_<dbscheme>) and the developer should start a
background logging process from their unix-user and make it log to their logging
directory. Control of the log pipe should be put into the log context
(PLOG.LOG_CTX) and set in the init function. Default could be LOG_PIPE for
backward compatibility. The background Java logging process should read pipe to
use from configuration, the same way it configures db username/password. Again
it could default to LOG_PIPE.
I hope you will consider this enhancement. It
should be a fairly simple change to implement - if needed I can send the updates
to V2.1.1, but at the moment I do not have access to compile SQLJ.
I realize there are some initiatives to have
the Log4plsql project join the Apache Logging Services project, and I am
uncertain to what this means to the current implementation and future
development. Please advise if you can.
BR.
Allan
|
