Oracle中pls_logger记录日志信息

/*
 参数说明:
 pi_program_name    程序名称
 pi_directory        写入日志文件所在的目录
 pi_file            日志文件名称,必须存在
 pi_log_level        日记级别,INFO、WARN、FATAL
 pi_write_to        写到哪里,SCREEN、FILE、TABLE、ALL
 pi_error_message   写入到日志的错误信息
 
  pi_status            输出参数 1失败 0成功
*/
BEGIN
    pls_logger  ( pi_program_name   => SCREEN_PROGRAM_ERROR
                , pi_log_level      => INFO
                , pi_write_to       => SCREEN
                , pi_error_message  => This execution writes to SCREEN.
                );

    pls_logger  ( pi_program_name   => WARN_PROGRAM_ERROR
                , pi_log_level      => WARN
                , pi_write_to       => TABLE
                , pi_error_message  => This execution writes to TABLE.
                );
                
    pls_logger  ( pi_program_name     => FATAL_PROGRAM_ERROR
                , pi_log_level        => FATAL
                , pi_write_to         => FILE
                , pi_error_message    => This execution writes to FILE.
                , pi_file             => my_logfile.txt
                );
                
    pls_logger  ( pi_program_name   => FATAL_PROGRAM_ERROR
                , pi_log_level      => FATAL
                , pi_write_to       => ALL
                , pi_error_message  => This execution writes to ALL.
                , pi_file           => my_logfile.txt
                );
END;
/

 

Oracle中pls_logger记录日志信息,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。