elmah oracle
- .
- <sectionGroup name="elmah">
- <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
- <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
- <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
- <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
- </sectionGroup>
- .
- <httpModules>
- <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
- <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
- <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
- </httpModules>
- .
- <modules runAllManagedModulesForAllRequests="true">
- <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
- <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
- <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
- </modules>
- .
- <elmah>
- <!--
- See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for
- more information on remote access and securing ELMAH.
- -->
- <security allowRemoteAccess="false" />
- <errorLog type="Elmah.OracleErrorLog, Elmah" connectionStringName="elmah-oracle" schemaOwner="" />
- </elmah>
- <location path="elmah.axd" inheritInChildApplications="false">
- <system.web>
- <httpHandlers>
- <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
- </httpHandlers>
- <!--
- See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for
- more information on using ASP.NET authorization securing ELMAH.
- <authorization>
- <allow roles="admin" />
- <deny users="*" />
- </authorization>
- -->
- </system.web>
- <system.webServer>
- <handlers>
- <add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
- </handlers>
- </system.webServer>
- </location>
- .
- <connectionStrings>
- <!-- TODO: Replace the ****'s with the correct entries --> <add name="elmah-oracle" connectionString="Data Source=****;User ID=****;Password=****;" />
- </connectionStrings>
- .oracle脚本
- /*
- ELMAH - Error Logging Modules and Handlers for ASP.NET
- Copyright (c) 2004-9 Atif Aziz. All rights reserved.
- Author(s):
- James Driscoll, mailto:jamesdriscoll@btinternet.com
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */
- -- $Id: Oracle.sql -- ::34Z azizatif $
- -- NB This script assumes you have logged on in the schema where you want to create the ELMAH objects
- -- create a sequence for the errors (user to simulate an identity in SQL Server)
- CREATE SEQUENCE elmah$error_seq START WITH INCREMENT BY NOMAXVALUE NOCYCLE NOCACHE NOORDER;
- -- create the table to store the data
- -- you can optionally specify tablespaces here too!
- CREATE TABLE elmah$error
- (
- -- if using Oracle 10g and above you can add DEFAULT SYS_GUID()
- -- to the errorid definition.
- -- Oracle 8i doesn't like it with an NVARCHAR2
- -- haven't tested it against 9i
- errorid NVARCHAR2() NOT NULL,
- application NVARCHAR2() NOT NULL,
- host NVARCHAR2() NOT NULL,
- type NVARCHAR2() NOT NULL,
- source NVARCHAR2(),
- message NVARCHAR2() NOT NULL,
- username NVARCHAR2(),
- statuscode NUMBER NOT NULL,
- timeutc DATE NOT NULL,
- sequencenumber NUMBER NOT NULL,
- allxml NCLOB NOT NULL,
- CONSTRAINT idx_elmah$error_pk
- PRIMARY KEY (errorid)
- USING INDEX -- TABLESPACE "TABLESPACE FOR INDEX"
- ) -- TABLESPACE "TABLESPACE FOR DATA"
- /
- -- trigger to make sure we get our sequence number in the table
- CREATE TRIGGER trg_elmah$error_bi
- BEFORE INSERT ON elmah$error
- FOR EACH ROW
- BEGIN
- SELECT elmah$error_seq.NEXTVAL INTO :new.sequencenumber FROM dual;
- END trg_elmah$error_bi;
- /
- -- create the index on the table
- CREATE INDEX idx_elmah$error_app_time_seq ON elmah$error(application, timeutc DESC, sequencenumber DESC)
- /
- -- package containing the procedure we need for ELMAH to log errors
- CREATE OR REPLACE PACKAGE pkg_elmah$log_error
- IS
- PROCEDURE LogError
- (
- v_ErrorId IN elmah$error.errorid%TYPE,
- v_Application IN elmah$error.application%TYPE,
- v_Host IN elmah$error.host%TYPE,
- v_Type IN elmah$error.type%TYPE,
- v_Source IN elmah$error.source%TYPE,
- v_Message IN elmah$error.message%TYPE,
- v_User IN elmah$error.username%TYPE,
- v_AllXml IN elmah$error.allxml%TYPE,
- v_StatusCode IN elmah$error.statuscode%TYPE,
- v_TimeUtc IN elmah$error.timeutc%TYPE
- );
- END pkg_elmah$log_error;
- /
- CREATE OR REPLACE PACKAGE BODY pkg_elmah$log_error
- IS
- PROCEDURE LogError
- (
- v_ErrorId IN elmah$error.errorid%TYPE,
- v_Application IN elmah$error.application%TYPE,
- v_Host IN elmah$error.host%TYPE,
- v_Type IN elmah$error.type%TYPE,
- v_Source IN elmah$error.source%TYPE,
- v_Message IN elmah$error.message%TYPE,
- v_User IN elmah$error.username%TYPE,
- v_AllXml IN elmah$error.allxml%TYPE,
- v_StatusCode IN elmah$error.statuscode%TYPE,
- v_TimeUtc IN elmah$error.timeutc%TYPE
- )
- IS
- BEGIN
- INSERT INTO elmah$error
- (
- errorid,
- application,
- host,
- type,
- source,
- message,
- username,
- allxml,
- statuscode,
- timeutc
- )
- VALUES
- (
- UPPER(v_ErrorId),
- v_Application,
- v_Host,
- v_Type,
- v_Source,
- v_Message,
- v_User,
- v_AllXml,
- v_StatusCode,
- v_TimeUtc
- );
- END LogError;
- END pkg_elmah$log_error;
- /
- -- package containing the procedure we need for ELMAH to retrieve errors
- CREATE OR REPLACE PACKAGE pkg_elmah$get_error
- IS
- -- NB this is for backwards compatibility with Oracle 8i
- TYPE t_cursor IS REF CURSOR;
- PROCEDURE GetErrorXml
- (
- v_Application IN elmah$error.application%TYPE,
- v_ErrorId IN elmah$error.errorid%TYPE,
- v_AllXml OUT elmah$error.allxml%TYPE
- );
- PROCEDURE GetErrorsXml
- (
- v_Application IN elmah$error.application%TYPE,
- v_PageIndex IN NUMBER DEFAULT ,
- v_PageSize IN NUMBER DEFAULT ,
- v_TotalCount OUT NUMBER,
- v_Results OUT t_cursor
- );
- END pkg_elmah$get_error;
- /
- CREATE OR REPLACE PACKAGE BODY pkg_elmah$get_error
- IS
- PROCEDURE GetErrorXml
- (
- v_Application IN elmah$error.application%TYPE,
- v_ErrorId IN elmah$error.errorid%TYPE,
- v_AllXml OUT elmah$error.allxml%TYPE
- )
- IS
- BEGIN
- SELECT allxml
- INTO v_AllXml
- FROM elmah$error
- WHERE errorid = UPPER(v_ErrorId)
- AND application = v_Application;
- EXCEPTION
- WHEN NO_DATA_FOUND THEN
- v_AllXml := NULL;
- END GetErrorXml;
- PROCEDURE GetErrorsXml
- (
- v_Application IN elmah$error.application%TYPE,
- v_PageIndex IN NUMBER DEFAULT ,
- v_PageSize IN NUMBER DEFAULT ,
- v_TotalCount OUT NUMBER,
- v_Results OUT t_cursor
- )
- IS
- l_StartRowIndex NUMBER;
- l_EndRowIndex NUMBER;
- BEGIN
- -- Get the ID of the first error for the requested page
- l_StartRowIndex := v_PageIndex * v_PageSize + ;
- l_EndRowIndex := l_StartRowIndex + v_PageSize - ;
- -- find out how many rows we've got in total
- SELECT COUNT(*)
- INTO v_TotalCount
- FROM elmah$error
- WHERE application = v_Application;
- OPEN v_Results FOR
- SELECT *
- FROM
- (
- SELECT e.*,
- ROWNUM row_number
- FROM
- (
- SELECT /*+ INDEX(elmah$error, idx_elmah$error_app_time_seq) */
- errorid,
- application,
- host,
- type,
- source,
- message,
- username,
- statuscode,
- timeutc
- FROM elmah$error
- WHERE application = v_Application
- ORDER BY
- timeutc DESC,
- sequencenumber DESC
- ) e
- WHERE ROWNUM <= l_EndRowIndex
- )
- WHERE row_number >= l_StartRowIndex;
- END GetErrorsXml;
- END pkg_elmah$get_error;
- /
- /*
- -- If you are securing the packages above, you will need to grant execute
- -- privileges on them so that they can be called by the user connecting to the database.
- -- NB As long as you use the schema owner for the connection string, this is not necessary,
- -- although this is generally discouraged by Best Practices.
- -- Option 1) Allow any user to execute the package (not recommended)
- -- replace OWNER for the schema owner in the following statement
- GRANT EXECUTE ON OWNER.pkg_elmah$log_error TO PUBLIC;
- GRANT EXECUTE ON OWNER.pkg_elmah$get_error TO PUBLIC;
- -- Option 2) Allow a single user to execute the package (better)
- -- replace OWNER for the schema owner in the following statement
- GRANT EXECUTE ON OWNER.pkg_elmah$log_error TO USER_NAME;
- GRANT EXECUTE ON OWNER.pkg_elmah$get_error TO USER_NAME;
- -- Option 3) Lock things down so that one user can only log errors, while another user can read and log errors (most secure)
- -- replace OWNER for the schema owner in the following statement
- -- LOGGING_USER_NAME will be used to connect to the database in all sites which log errors to the database
- GRANT EXECUTE ON OWNER.pkg_elmah$log_error TO LOGGING_USER_NAME;
- -- ADMIN_USER_NAME will be used to connect to the database in an admin portal which allows users to read errors
- GRANT EXECUTE ON OWNER.pkg_elmah$log_error TO ADMIN_USER_NAME;
- GRANT EXECUTE ON OWNER.pkg_elmah$get_error TO ADMIN_USER_NAME;
- -- NB if you do take this approach, be sure to set the schemaOwner parameter in your web.config
- */
- Oracle创建表脚本
elmah oracle的更多相关文章
- Elmah 日志记录组件
http://www.cnblogs.com/jys509/p/4571298.html 简介 ELMAH(Error Logging Modules and Handlers)错误日志记录模块和处理 ...
- ELMAH入门
简介 ELMAH(Error Logging Modules and Handlers)错误日志记录模块和处理程序,是一种应用广泛的错误日志工具是完全可插拔.它可以动态添加到一个正在运行的ASP.NE ...
- 【工具推荐】ELMAH——可插拔错误日志工具
今天看到一篇文章(构建ASP.NET网站十大必备工具(2)),里面介绍了一个ELMAH的错误日志工具,于是研究了一下. ELMAH 是 Error Logging Modules and Handle ...
- elmah - Error Logging Modules and Handlers for ASP.NET - 1 : 初体验
elmah(英文):https://code.google.com/p/elmah/ 写作思路:先看结果,然后再说原理 elmah文章基本内容如下 1.安装 2.基本使用 3.详细配置讲解 ...
- ELMAH 使用
之前大部分系统日志记录是使用log4net.ObjectGuy Framework.NLog 等工具记录到文本或数据库. 更强大的工具可以使用 ELMAH. ELMAH(The Error Loggi ...
- 【工具推荐】ELMAH——可插拔错误日志工具(转)
出处:http://www.cnblogs.com/liping13599168/archive/2011/02/23/1962625.html 今天看到一篇文章(构建ASP.NET网站十大必备工具( ...
- Oracle分析函数入门
一.Oracle分析函数入门 分析函数是什么?分析函数是Oracle专门用于解决复杂报表统计需求的功能强大的函数,它可以在数据中进行分组然后计算基于组的某种统计值,并且每一组的每一行都可以返回一个统计 ...
- Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级
Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级 环境:OEL 5.7 + Oracle 10.2.0.5 RAC 5.安装Database软件 5. ...
- Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part1:准备工作
Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part1:准备工作 环境:OEL 5.7 + Oracle 10.2.0.5 RAC 1.实施前准备工作 1.1 服务器安装操 ...
随机推荐
- java代码----FileInputStream 和File
总结:程序运行后,发现新建的两个文件里的东西突然i清空了.以为是程序出错了. 然后慌了,之后我再运行时,发现可以了.是电脑的问题吧 一如既往的打扰他,只因为他优秀 package com.a.b; i ...
- 字符串的问题(substr,find用法)
链接:https://www.nowcoder.com/acm/contest/77/C来源:牛客网 字符串的问题 时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 262144K,其他 ...
- MySQL Connector/NET 使用小结(踩坑之路)
背景描述 根据项目的需要,需连接MySQL获取数据. 首先,先了解一下项目的情况: 之前的代码是C#编写的的, 运行时:.NETFramework3.5. 由于项目已经部署上线,因此不能升级运行时,这 ...
- node的socket.io类库概述
socket.io是一个简单的小类库,该类库实现的功能类似于node中的net模块所实现的功能. 这些功能包括websocket通信,xhr轮询,jsonp轮询等. socket类库可以接受所有与服务 ...
- socket_udp客户端循环输入
server--------------#!/usr/bin/env python # encoding: utf-8 # Date: 2018/6/7 from socket import * s ...
- linux加程序是否当掉检测脚本
cd $(dirname $) source ~/.bash_profile SYSTEM_TIME=`date '+%Y-%m-%d %T'` count=`ps -ef |grep "p ...
- toString()和toLocaleString()的区别
在数字转换成字符串的时候,并没有感觉这两个方法有什么区别,如下: 1 2 3 4 5 6 7 8 var e=123 e.toString() "123" e.toLo ...
- angualr 之 $$phase
对于angular, $$phase 是 作为angular 内部状态表示位,用来标示当前是处于哪个阶段. 用有的阶段有 $digest $apply 在使用的是例如你想调用scope.$apply的 ...
- 一个简单的异常/条件重试类(C#)
单个类,简单好用 using System; using System.Linq.Expressions; using System.Threading; using System.Threading ...
- 5.Redis 发布订阅
转自:http://www.runoob.com/redis/redis-tutorial.html Redis 发布订阅(pub/sub)是一种消息通信模式:发送者(pub)发送消息,订阅者(sub ...