Oracle 中基于级别的日志记录
我是卡纳加拉吉。在我们的存储过程中,我们在 500 个位置记录消息,并且日志存储在我们遇到一些性能问题的表中。我们需要将这些消息分为调试消息、信息消息和错误消息。根据级别,仅应记录有限的消息。如有必要,我们将启用下一个级别并查看更多日志。在我们的程序中引入这种基于级别的日志记录的有效方法是什么?
提前致谢。
卡纳加拉吉。
I am Kanagaraj. In our stored procedure, we are logging messages at 500 places and logs are stored in a table where we are having some performance issues. We need to split these messages into Debug, Info and Error messages. Based on the level, only limited messages should be logged. If necessary, we will be enabling the next level and see the more logs. What could be the effective way for introducing this level based logging in our procedure?.
Thanks in advance.
Kanagaraj.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
像这样的东西......
编辑:添加
pragmaautonomous_transaction;
,谢谢亚当Something like this...
EDIT: Added
pragma autonomous_transaction;
, thanks Adam在 sourceforge 上可以找到适用于 Oracle PL/SQL 的 log4j 端口。这允许在各个级别启用/禁用日志记录,并且对于特定的包/功能/过程,只需修改配置即可。它还支持重定向到不同的目的地。
There is a port of log4j for Oracle PL/SQL that can be found on sourceforge. This allows logging to be enabled/disabled at various levels, and for specific packages/functions/procedures simply be modifying a configuration. It also supports redirection to different destinations.
有点晚了;我建议您使用 Logger: https://github.com/tmuth /Logger---A-PL-SQL-Logging-Utility 它将满足您的要求。
A bit late; I recommend you use Logger: https://github.com/tmuth/Logger---A-PL-SQL-Logging-Utility It will handle your requirements.
查看 PLJ-Logger,网址为 https://sourceforge.net/p/plj-logger/home/ 。它非常容易实现,并且具有您想要的功能等等。 PL/SQL 代码中内置的正确日志记录将改变它。
磷
Check out PLJ-Logger at https://sourceforge.net/p/plj-logger/home/. Its really easy to implement and has your desired functionality and a lot more. Proper logging built into PL/SQL code will transform it.
P