Home > Database > Mysql Tutorial > body text

NHibernate+Oracle10g搭建一个项目架构全程解析(五)

WBOY
Release: 2016-06-07 15:37:10
Original
1028 people have browsed it

七、为表示层项目添加日志能力 1、在Web.Config里面添加如下代码: configdivs div name="log4net" type="log4net.Config.Log4NetConfigurationdivHandler,log4net"/ /configdivs log4net root level value="INFO" / appender-ref ref="LogFileAppender" / a

七、为表示层项目添加日志能力

 

    1、在Web.Config里面添加如下代码:   

   2、在持久层项目OfficeDAL里面Properties的AssemblyInfo.cs文件添加如下代码:

[assembly: log4net.Config.XmlConfigurator(ConfigFile="Web.Config",Watch=true)]

 

运行Web项目,将会在项目下生成日志文件log-file.txt

NHibernate+Oracle10g搭建一个项目架构全程解析(五)

 

3、我们可以在持久层添加自己的日志代码,做日志输出:

 

观察日志文件输出:

NHibernate+Oracle10g搭建一个项目架构全程解析(五)

 

 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!