log4net xsd schema 智能提示文件

本文介绍了一种log4net配置文件使用的XSD模式,通过该模式可以为log4net配置文件提供自动补全和语法检查功能。文章详细解释了如何在log4net配置文件中应用XSD模式,并提供了示例来展示如何用参数代替某些元素。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Author: Roger Knapp
Url:    http://csharptest.net/downloads/schema/log4net.xsd
Proj:   http://csharptest.net/downloads/projects/log4net.config.zip
Date:   November 7th, 2008
Rev:    1.01
Usage:  You only need to add the following to the log4net element:
        <log4net
          xsi:noNamespaceSchemaLocation="http://csharptest.net/downloads/schema/log4net.xsd"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

(注:你要想得到智能提示,你只需要在log4net这个节点里加上xsi: xmlns:两个属性即可,赶快试试吧。)

Preface:
Please be aware that though this xsd attempts to cover most of the usages you
will encounter with log4net configurations it is by no means complete.  The
primary reason (excuse) for this is that the xml format used by log4net config
files does not conform to any real standard.  This is both it's primary
weakness and it's strength.  As such there are a few things you should know
about how log4net interprets your configuration before creating one.

Firstly most of the elements described in this document are really not needed. 
This is due to the fact that a <param name='x' ...> can be used in place of
the element <x ...>.  For instance, the following are equivalent:
    <maximumFileSize value="1MB" />
    <param name="maximumFileSize" value="1MB" />

So Why Use This Xsd?:
This xsd attempts to utilize the former convention and to declare as much as
possible for the benefit of auto-completion and sanity checking.  However,
since most of the param names vary by the containing element's 'type' attribute
it is impossible to describe this correctly in xsd (at least to my knowledge). 
So use this schema if you like and remember that there is life beyond it's
limited capability.

If you would like to contribute back to this schema you can send email to the
follow address (remove all the spaces and slashes): schema / @ / csharptest.net
Be sure to include the schema name "log4net.xsd" in the subject-line.  If you
know someone on the log4net project please convince them to adopt a schema,
I don't care which one, just have one.

Legal:
   Copyright 2008 by Roger Knapp

   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.

 

转载于:https://www.cnblogs.com/yelaiju/archive/2010/12/19/1910351.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值