前面我们说了用oracle自带的审计功能可以实现记录用户登录失败日志到数据表中(链接:http://www.54ok.cn/6778.html).今天我们来分享一下如何把用户登录失败信息记录到alert.log日志文件中. 使用sys账号登录数据库,然后创建触发器. CREATE OR REPLACE TRIGGER logon_denied_to_alert AFTER servererror ON DATABASEDECLARE message VARCHAR2(168); ip
----------------- [1] use master go sp_configure reconfigure with override go ----------------- [2] where dbid=DB_ID('zc_post') ----------------- [3] dbcc rebuild_log('zc_post','d:\zc_post_log.ldg') ----------------- [4] dbcc checkdb('zc_post') -----
/** * 生成日志文件(文件的位置在Tomcat的安装路径下) * @param str */ public static void LogForTXT(String str) { try { String dir = System.getProperty("user.dir") + File.separator + "系统日志"; File fi = new File(dir); if (!fi.exists()) { fi.mkdirs(); } Date d
using System; using System.Globalization; using System.IO; using System.Text; using System.Windows.Forms; namespace app.Lib { public enum Level { Debug, Exception, Info, Warn, } public enum Priority { None, High, Medium, Low, } public class Logger {