using System; using System.Collections.Generic; using System.Text; using Zhaizj.Framework.Config.DotNetConfig; using System.Configuration; namespace Zhaizj.Framework.Data.Config { /// /// 数据库配置方式 /// /// /// 配置文件格式和说明: /// /// /// ; ///
; /// /// /// /// /// /// /// ...... /// /// public class SectionLogHandler : SectionBaseHandler { /// /// 配置日志级别 /// [ConfigurationProperty("LogLevel", DefaultValue = "info")] public string LogLevel { get { return (string)this["LogLevel"]; } } /// /// 配置日志路径 /// [ConfigurationProperty("LogFile", DefaultValue = "yyyyMMdd")] public string LogFile { get { return (string)this["LogFile"]; } } /// /// 配置日志路径 /// [ConfigurationProperty("LogPath", DefaultValue = "log")] public string LogPath { get { return (string)this["LogPath"]; } } /// /// 读取配置文件 /// /// public string GetLogConfig() { StringBuilder tagData = new StringBuilder(); tagData.AppendLine("logLevel : " + LogLevel); tagData.AppendLine("logFile : " + LogFile); tagData.AppendLine("logPath : " + LogPath); return tagData.ToString(); } } }