tmuth/Logger---A-PL-SQL-Logging-Utility

Log CURRENT_SCHEMA

patrickjolliffe opened this issue · 5 comments

For some scheduled tasks we use external authentication to call the same stored procedure defined on multiple schemas (ie phtutl.purge_pkg.purge, thtutl.purge_pkg.purge).
For current logging version, it is not easy to see which of the stored procedures is being called, because the username field is populated with the external username, OS$ORACLE, only.
I think it may be useful to have an additional field (schema_name?) which is populated with the value of "SYS_CONTEXT ('USERENV', 'CURRENT_SCHEMA')".
Note not a huge deal for us, as we have configured the dbms_application_info action field in our calling process, and also can infer from the UNIT_NAME field.

Why not do: logger.log('Some log', 'youre scope ' || sys_context('userenv','current_schema));

there is no real need for a separate field in my opinion.

I agree that we probably don't want to add an additional field just yet. Is there any reason why you don't just create multiple logger schemas (one for each parent schema). For instance logger_phtutl and logger_thutl. Then each parent schema have references to their associated logger schema?

I prefer to have single location for all applications log data (database hosts many applications), but understand this is a matter of preference. As mentioned, not really a bit deal, no problem to close.

Will close the ticket. We also have a "user" column which uses either the APEX user (if exists) or the USER value.

If we get more requests for the CURRENT_SCHEMA user we'll re-evaluate this request.

This issue was moved to OraOpenSource#34