Commit a2088003 by mahaisong

feat:调用ES,返回数据、解析,封装成指定的json格式,放入json文件

parent 7fc356d7
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<configuration> <configuration>
<startup>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
</configSections>
<connectionStrings>
<add name="ESDatabase" connectionString="host=mech.palaspom.com|tank.palaspom.com;port=19235;defaultIndex=palas" />
</connectionStrings>
<common>
<logging>
<factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4Net208">
<!--FILE
FILE-WATCH log4net节点在其他独立文件内部。
INLINE log4net节点在配置app.config内部。
EXTERNAL-->
<arg key="configType" value="FILE-WATCH" />
<arg key="configFile" value="~/Config/log4net.config" />
</factoryAdapter>
</logging>
</common>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup> </startup>
</configuration> </configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<log4net>
<appender name="errorAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="ERROR" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\err.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="infoAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\info.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="debugAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="DEBUG" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\debug.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="perfAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\perf.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %logger - %message%newline" />
</layout>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="errorAppender" />
<appender-ref ref="infoAppender" />
<appender-ref ref="debugAppender" />
</root>
<logger name="Performance" additivity="false">
<level value="ALL" />
<appender-ref ref="perfAppender" />
</logger>
</log4net>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<log4net>
<appender name="errorAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="ERROR" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<File value="Logs/err.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="infoAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs/info.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="debugAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="DEBUG" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs/debug.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="perfAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs/perf.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %logger - %message%newline" />
</layout>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="errorAppender" />
<appender-ref ref="infoAppender" />
<appender-ref ref="debugAppender" />
</root>
<logger name="Performance" additivity="false">
<level value="ALL" />
<appender-ref ref="perfAppender" />
</logger>
</log4net>
\ No newline at end of file
...@@ -32,7 +32,40 @@ ...@@ -32,7 +32,40 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Common.Logging, Version=3.4.1.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
<HintPath>..\packages\Common.Logging.3.4.1\lib\net40\Common.Logging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Common.Logging.Core, Version=3.4.1.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
<HintPath>..\packages\Common.Logging.Core.3.4.1\lib\net40\Common.Logging.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Common.Logging.Log4Net208, Version=3.4.1.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
<HintPath>..\packages\Common.Logging.Log4Net208.3.4.1\lib\net40\Common.Logging.Log4Net208.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Elasticsearch.Net, Version=2.0.0.0, Culture=neutral, PublicKeyToken=96c599bbe3e70f5d, processorArchitecture=MSIL">
<HintPath>..\packages\Elasticsearch.Net.2.5.8\lib\net45\Elasticsearch.Net.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MongoDB.Bson, Version=2.0.0.828, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MongoDB.Bson.2.0.0\lib\net45\MongoDB.Bson.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Nest, Version=2.0.0.0, Culture=neutral, PublicKeyToken=96c599bbe3e70f5d, processorArchitecture=MSIL">
<HintPath>..\packages\NEST.2.5.8\lib\net45\Nest.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
...@@ -45,15 +78,21 @@ ...@@ -45,15 +78,21 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="ESClientConfigureManager.cs" />
<Compile Include="ESItemAccess.cs" />
<Compile Include="Form1.cs"> <Compile Include="Form1.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Form1.Designer.cs"> <Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>Form1.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Item.cs" />
<Compile Include="ListModel.cs" /> <Compile Include="ListModel.cs" />
<Compile Include="LogService.cs" />
<Compile Include="PerformanceUtility.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ResultModel\ResultItem.cs" />
<Compile Include="V1.cs" /> <Compile Include="V1.cs" />
<EmbeddedResource Include="Form1.resx"> <EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>Form1.cs</DependentUpon>
...@@ -67,6 +106,13 @@ ...@@ -67,6 +106,13 @@
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>
</Compile> </Compile>
<None Include="Config\log4net.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="OutPut\模板.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
...@@ -80,6 +126,7 @@ ...@@ -80,6 +126,7 @@
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />
</ItemGroup> </ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</Project>
\ No newline at end of file
using Elasticsearch.Net;
using Nest;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace CsvCount_ES
{
public sealed class ESClientConfigureManager
{
public static List<Uri> Uris { get; private set; }
public static String DefaultIndex { get; private set; }
/// <summary>
/// ES连接设置
/// </summary>
public static ConnectionSettings ConnectSetting { get; private set; }
private const String ConnectionStringIndex = "ESDatabase";
private const String HostIndex = "host";
private const String PortIndex = "port";
private const String DefaultIndexIndex = "defaultIndex";
static ESClientConfigureManager()
{
String connectionString = ConfigurationManager.ConnectionStrings[ConnectionStringIndex].ConnectionString;
String[] namedValues = connectionString.Split(';');
Dictionary<String, String> nvPair = new Dictionary<String, String>();
foreach (String nv in namedValues)
{
String[] pair = nv.Split('=');
nvPair[pair[0]] = pair[1];
}
String _url = GetValueByName(nvPair, HostIndex, "tank.palaspom.com|mech.palaspom.com");
String _port = GetValueByName(nvPair, PortIndex, "19235");
//支持多Uri模式,要求多个链接使用 | 分隔,在分隔后数量相同的情况下按照顺序一一对应,如果其中一方仅有一个则使用它对应对方所有部分
string[] urls = _url.Split('|');
string[] ports = _port.Split('|');
if (urls == null || ports == null || urls.Length < 1 || ports.Length < 1)
throw new Exception("Unable get the elasticsearch config pool setting.");
Uris = new List<Uri>();
if (urls.Length == ports.Length)
{
for (int i = 0; i < urls.Length; i++)
{
String formattedUrl = Regex.IsMatch(urls[i], @"://") ? urls[i] : String.Format("http://{0}", urls[i]);
Uris.Add(new Uri(String.Format("{0}:{1}", formattedUrl, ports[i])));
}
}
else if (urls.Length > 1 && ports.Length == 1)
{
for (int i = 0; i < urls.Length; i++)
{
String formattedUrl = Regex.IsMatch(urls[i], @"://") ? urls[i] : String.Format("http://{0}", urls[i]);
Uris.Add(new Uri(String.Format("{0}:{1}", formattedUrl, ports[0])));
}
}
else if (urls.Length == 1 && ports.Length > 1)
{
String formattedUrl = Regex.IsMatch(urls[0], @"://") ? urls[0] : String.Format("http://{0}", urls[0]);
for (int i = 0; i < ports.Length; i++)
{
Uris.Add(new Uri(String.Format("{0}:{1}", formattedUrl, ports[i])));
}
}
else
{
throw new Exception("The elasticsearch config pool setting is error.");
}
var pool = new StaticConnectionPool(Uris);
String index = GetValueByName(nvPair, DefaultIndexIndex, "palas");
DefaultIndex = index;
ConnectSetting = new ConnectionSettings(pool).BasicAuthentication("carey", "jfyhdcm").DefaultIndex(index).DisableDirectStreaming();
}
private static String GetValueByName(Dictionary<String, String> nvPair, String name, String defaultValue)
{
String value = null;
if (nvPair.TryGetValue(name, out value))
{
return value;
}
return defaultValue;
}
}
}
using Nest;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CsvCount_ES
{
/// <summary>
/// 直接获取ESData的特殊类
/// </summary>
public class ESItemAccess : ESAccess
{
public const string NullValue = "空空";
/// <summary>
/// 根据itemID搜索Item
/// </summary>
/// <param name="id">itemID</param>
/// <returns>返回实体</returns>
public static Item SearchByItemID(string id)
{
SearchDescriptor<Item> builder = new SearchDescriptor<Item>()
.Size(1)
.Query(q => q
.Bool(b => b
.Must(m => m
.QueryString(qs => qs.DefaultField(f => f.ItemID).Query(id))
)
)
);
try
{
return SearchTop(builder);
}
catch (Exception e)
{
LogService.WriteError(string.Format("ES SearchByItemID Fail:{0} ItemID:{1}", e.ToString(), id));
return null;
}
}
/// <summary>
/// 根据itemID搜索Item
/// </summary>
/// <param name="id">itemID</param>
/// <returns>返回实体</returns>
public static Item[] SearchByItemIDs(List<string> itemIds)
{
SearchDescriptor<Item> builder = new SearchDescriptor<Item>()
.Size(1000)
.Query(q => q
.Bool(b => b
.Must(m => m
.QueryString(qs => qs.DefaultField(f => f.ItemID).Query("\"" + string.Join("\" \"", itemIds) + "\""))
)
)
);
try
{
return Search(builder);
}
catch (Exception e)
{
LogService.WriteError(string.Format("ES SearchByItemIDs Fail:{0}", e.ToString()));
return null;
}
}
}
public class ESAccess
{
/// <summary>
/// 从ES中搜索数据,仅返回需要的数据本体
/// </summary>
/// <param name="searchQuery">查询条件</param>
/// <typeparam name="T">需要查询的类</typeparam>
/// <returns>数据结果</returns>
public static T[] Search<T>(SearchDescriptor<T> searchQuery) where T : class
{
ISearchResponse<T> result = SearchDetail(searchQuery);
if (result == null || result.Documents == null)
return null;
else
return result.Documents.ToArray();
}
/// <summary>
/// 从ES中搜索数据,仅返回第一条数据本体
/// </summary>
/// <typeparam name="T">查询条件</typeparam>
/// <param name="searchQuery">需要查询的类</param>
/// <returns>数据结果</returns>
public static T SearchTop<T>(SearchDescriptor<T> searchQuery) where T : class
{
var response = Search(searchQuery);
if (response == null)
return null;
else
return response.FirstOrDefault();
}
/// <summary>
/// 从ES中搜索数据,返回详细信息,包括数据本体,查询时间,命中总数等
/// </summary>
/// <param name="searchQuery">查询条件</param>
/// <typeparam name="T">需要查询的类</typeparam>
/// <returns>统计数据结果集</returns>
public static ISearchResponse<T> SearchDetail<T>(SearchDescriptor<T> searchQuery) where T : class
{
ElasticClient client = new ElasticClient(ESClientConfigureManager.ConnectSetting);
ISearchResponse<T> response = null;
try
{
response = PerformanceUtility.OperationTimedMonitor<ISearchResponse<T>>(
PerformanceUtility.DefaultTriggerTimeSpan,
PerformanceUtility.DefaultIntervalTimeSpan,
Serialize(searchQuery),
//searchQuery.ExplainJson(),
() => { return client.Search<T>(searchQuery); });
var isItem = typeof(T) == typeof(Item);
if (isItem)
{
foreach (var document in response.Documents)
{
var item = document as Item;
ReverseNullValueForQuery(item);
}
}
}
catch (Exception e)
{
LogService.WriteError("ESAccess SearchDetail Fail", e);
}
return response;
}
public static void ReverseNullValueForQuery(Item item)
{
if (item.DuplicationID == ESItemAccess.NullValue)
{
item.DuplicationID = null;
}
}
public static string Serialize<T>(T obj) where T : class
{
try
{
ElasticClient client = new ElasticClient(ESClientConfigureManager.ConnectSetting);
using (MemoryStream stream = new MemoryStream())
{
client.Serializer.Serialize(obj, stream);
byte[] b = stream.ToArray();
return Encoding.UTF8.GetString(b, 0, b.Length);
}
}
catch
{
return "";
}
}
public static T Deserialize<T>(string json) where T : class
{
ElasticClient client = new ElasticClient(ESClientConfigureManager.ConnectSetting);
return client.Serializer.Deserialize<T>(new MemoryStream(Encoding.UTF8.GetBytes(json)));
}
}
}
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
this.textBox_path = new System.Windows.Forms.TextBox(); this.textBox_path = new System.Windows.Forms.TextBox();
this.label_wait = new System.Windows.Forms.Label(); this.label_wait = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.textBox_block = new System.Windows.Forms.TextBox();
this.SuspendLayout(); this.SuspendLayout();
// //
// openFileDialog1 // openFileDialog1
...@@ -47,7 +49,7 @@ ...@@ -47,7 +49,7 @@
// //
// button1 // button1
// //
this.button1.Location = new System.Drawing.Point(432, 40); this.button1.Location = new System.Drawing.Point(503, 34);
this.button1.Name = "button1"; this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23); this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0; this.button1.TabIndex = 0;
...@@ -57,15 +59,15 @@ ...@@ -57,15 +59,15 @@
// //
// textBox1 // textBox1
// //
this.textBox1.Location = new System.Drawing.Point(76, 40); this.textBox1.Location = new System.Drawing.Point(113, 37);
this.textBox1.Name = "textBox1"; this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(350, 20); this.textBox1.Size = new System.Drawing.Size(352, 20);
this.textBox1.TabIndex = 1; this.textBox1.TabIndex = 1;
// //
// label1 // label1
// //
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(3, 40); this.label1.Location = new System.Drawing.Point(3, 37);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(67, 13); this.label1.Size = new System.Drawing.Size(67, 13);
this.label1.TabIndex = 2; this.label1.TabIndex = 2;
...@@ -74,18 +76,18 @@ ...@@ -74,18 +76,18 @@
// button2 // button2
// //
this.button2.Enabled = false; this.button2.Enabled = false;
this.button2.Location = new System.Drawing.Point(76, 80); this.button2.Location = new System.Drawing.Point(503, 77);
this.button2.Name = "button2"; this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(99, 27); this.button2.Size = new System.Drawing.Size(99, 27);
this.button2.TabIndex = 3; this.button2.TabIndex = 3;
this.button2.Text = "2:开始执行分析"; this.button2.Text = "2:开始执行分析";
this.button2.UseVisualStyleBackColor = true; this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click); this.button2.Click += new System.EventHandler(this.button2_ES_Click);
// //
// label2 // label2
// //
this.label2.AutoSize = true; this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(3, 153); this.label2.Location = new System.Drawing.Point(6, 121);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(58, 13); this.label2.Size = new System.Drawing.Size(58, 13);
this.label2.TabIndex = 5; this.label2.TabIndex = 5;
...@@ -95,7 +97,7 @@ ...@@ -95,7 +97,7 @@
// //
this.listBox1.Enabled = false; this.listBox1.Enabled = false;
this.listBox1.FormattingEnabled = true; this.listBox1.FormattingEnabled = true;
this.listBox1.Location = new System.Drawing.Point(76, 122); this.listBox1.Location = new System.Drawing.Point(113, 121);
this.listBox1.Name = "listBox1"; this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(431, 160); this.listBox1.Size = new System.Drawing.Size(431, 160);
this.listBox1.TabIndex = 8; this.listBox1.TabIndex = 8;
...@@ -113,7 +115,7 @@ ...@@ -113,7 +115,7 @@
// textBox_path // textBox_path
// //
this.textBox_path.Enabled = false; this.textBox_path.Enabled = false;
this.textBox_path.Location = new System.Drawing.Point(115, 331); this.textBox_path.Location = new System.Drawing.Point(113, 331);
this.textBox_path.Name = "textBox_path"; this.textBox_path.Name = "textBox_path";
this.textBox_path.Size = new System.Drawing.Size(517, 20); this.textBox_path.Size = new System.Drawing.Size(517, 20);
this.textBox_path.TabIndex = 10; this.textBox_path.TabIndex = 10;
...@@ -121,7 +123,7 @@ ...@@ -121,7 +123,7 @@
// label_wait // label_wait
// //
this.label_wait.AutoSize = true; this.label_wait.AutoSize = true;
this.label_wait.Location = new System.Drawing.Point(220, 87); this.label_wait.Location = new System.Drawing.Point(232, 77);
this.label_wait.Name = "label_wait"; this.label_wait.Name = "label_wait";
this.label_wait.Size = new System.Drawing.Size(0, 13); this.label_wait.Size = new System.Drawing.Size(0, 13);
this.label_wait.TabIndex = 11; this.label_wait.TabIndex = 11;
...@@ -131,15 +133,33 @@ ...@@ -131,15 +133,33 @@
this.label4.AutoSize = true; this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(6, 371); this.label4.Location = new System.Drawing.Point(6, 371);
this.label4.Name = "label4"; this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(239, 13); this.label4.Size = new System.Drawing.Size(381, 13);
this.label4.TabIndex = 12; this.label4.TabIndex = 12;
this.label4.Text = "参考:1.800W条记录不查ES,20秒统计次数"; this.label4.Text = "参考:1.800W条记录不查ES,7秒统计次数(400M,分块大小10240B)";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(3, 77);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(104, 13);
this.label5.TabIndex = 13;
this.label5.Text = "分块并行读取(B):";
//
// textBox_block
//
this.textBox_block.Location = new System.Drawing.Point(113, 77);
this.textBox_block.Name = "textBox_block";
this.textBox_block.Size = new System.Drawing.Size(119, 20);
this.textBox_block.TabIndex = 14;
// //
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(644, 408); this.ClientSize = new System.Drawing.Size(644, 408);
this.Controls.Add(this.textBox_block);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4); this.Controls.Add(this.label4);
this.Controls.Add(this.label_wait); this.Controls.Add(this.label_wait);
this.Controls.Add(this.textBox_path); this.Controls.Add(this.textBox_path);
...@@ -152,6 +172,7 @@ ...@@ -152,6 +172,7 @@
this.Controls.Add(this.button1); this.Controls.Add(this.button1);
this.Name = "Form1"; this.Name = "Form1";
this.Text = "Form1"; this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
...@@ -170,6 +191,8 @@ ...@@ -170,6 +191,8 @@
private System.Windows.Forms.TextBox textBox_path; private System.Windows.Forms.TextBox textBox_path;
private System.Windows.Forms.Label label_wait; private System.Windows.Forms.Label label_wait;
private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox textBox_block;
} }
} }
using System; 
using CsvCount_ES.ResultModel;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
...@@ -35,13 +38,16 @@ namespace CsvCount_ES ...@@ -35,13 +38,16 @@ namespace CsvCount_ES
//新建线程,线程数加一 //新建线程,线程数加一
return Interlocked.Increment(ref sn); return Interlocked.Increment(ref sn);
} }
int count = 0;
int errorCount = 0;
string filePath = "";
public Form1() public Form1()
{ {
InitializeComponent(); InitializeComponent();
this.listBox1.HorizontalScrollbar = true; this.listBox1.HorizontalScrollbar = true;
textBox_block.Text = "10240";
this.openFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); this.openFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
this.openFileDialog1.Filter = "数据文件|*.csv"; this.openFileDialog1.Filter = "数据文件|*.csv";
...@@ -56,8 +62,9 @@ namespace CsvCount_ES ...@@ -56,8 +62,9 @@ namespace CsvCount_ES
button2.Enabled = true; button2.Enabled = true;
listBox1.Items.Clear(); listBox1.Items.Clear();
count = 0;
errorCount = 0;
filePath = "";
textBox_path.Text = ""; textBox_path.Text = "";
label_wait.Text = "尚未开始执行!"; label_wait.Text = "尚未开始执行!";
} }
...@@ -73,238 +80,155 @@ namespace CsvCount_ES ...@@ -73,238 +80,155 @@ namespace CsvCount_ES
MessageBox.Show(ls.Text); MessageBox.Show(ls.Text);
} }
int count = 0;
int errorCount = 0;
private void button2_Click(object sender, EventArgs e) private void button2_Click(object sender, EventArgs e)
{ {
Stopwatch st = new Stopwatch();
st.Start();
if (!String.IsNullOrWhiteSpace(textBox1.Text)) if (!String.IsNullOrWhiteSpace(textBox1.Text))
{ {
#region 执行内存映射方案 Int64 length = 10240;//每次块大小 512000byte 500KB 这样1个G转2010次算完
//10兆字节(mb)=10485760字节(b)
//UTF-8编码中,一个英文字符等于一个字节,一个中文(含繁体)等于三个字节。 本次文件中主要是英文和数字,没有中文。所以要多少字就配多大块。
//50千字节(kb)=51200字节(b)
//200千字节(kb)=204800字节(b)
if (String.IsNullOrWhiteSpace(textBox_block.Text) || !Int64.TryParse(textBox_block.Text, out length))
{
MessageBox.Show("请正确输入分块并行读取(B)");
return;
}
label_wait.Text = "正在执行分析,请耐心等待........!"; label_wait.Text = "正在执行分析,请耐心等待........!";
button1.Enabled = false; button1.Enabled = false;
textBox1.Enabled = false; textBox1.Enabled = false;
button2.Enabled = false; button2.Enabled = false;
textBox_block.Enabled = false;
listBox1.Enabled = true; listBox1.Enabled = true;
filePath = Environment.CurrentDirectory + "\\OutPut\\" + ConvertDataTimeToLong(DateTime.Now).ToString() + ".json";
Application.DoEvents();
//输出测试
//for (int i = 0; i < 500; i++)
//{
// //跨线程访问
// this.BeginInvoke(new MethodInvoker(delegate ()
// {
// count = count + 1;
// this.listBox1.SuspendLayout();
// this.listBox1.Items.Add("开始:" + count.ToString() + "————————————————————————————————结束");
// this.listBox1.ResumeLayout(); Application.DoEvents();
// Application.DoEvents();
// })); #region 执行内存映射方案
//}
string filepath = openFileDialog1.FileName; string filepath = openFileDialog1.FileName;
setup: setup:
try try
{ {
#region 基本用法--820W行数据,439MB,转成字符串、split后,执行消耗24~25秒。 #region 并发用法:真正大文件时比StreamReader有用--820W行数据,439MB,转成字符串、split后,执行消耗7~8秒。 10K 1块。
////读取文件
//FileInfo fi = new FileInfo(filepath);
//Int64 size = fi.Length;//byte长度
//int offset = 0;
//int length = 512000;//每次块大小 512000byte 500KB 这样1个G转2010次算完
////UTF-8编码中,一个英文字符等于一个字节,一个中文(含繁体)等于三个字节。 本次文件中主要是英文和数字,没有中文。所以要多少字就配多大块。
//string fp2 = @filepath;
//using (MemoryMappedFile mmf = MemoryMappedFile.CreateFromFile(fp2, FileMode.Open, "mapname"))
//{
// using (var accessor = mmf.CreateViewAccessor(offset, size))
// {
// List<string> list = new List<string>();
// //每隔100是1行
// for (int i = 0; i < size; i += length)
// {
// byte[] byteArray = new byte[length];
// //ReadArray参数
// //position
// //Type: System.Int64
// //访问器中的字节偏移量,从此处开始读取。
// //array
// //Type: T[]
// //包含从访问器读取的结构的数组。
// //offset
// //Type: System.Int32
// //array 中要将第一个复制的结构放置到的索引。
// //count
// //Type: System.Int32
// //要从访问器读取的 T 类型的结构的数目。
// //resultcount:读入 array 的结构数。 如果可用结构较少,则此值可能小于 count;如果到达访问器末尾,则为零。
// int resultcount = accessor.ReadArray(i, byteArray, 0, length);
// //\r\n 空格 \n 都测试通过
// //\r 空格 \n 都算1个字符 规则:最后必须是\n结尾
// string str = System.Text.Encoding.Default.GetString(byteArray);
// int index = str.LastIndexOf('\n');
// string[] k = str.Split();
// count = count + k.Length;
// if (str.Length==index)
// {
// //最后一行可以分析
// }
// else
// {
// //str.IndexOf //读取文件
// //不相等,最后一行不能分析。 FileInfo fi = new FileInfo(filepath);
// //spilt时,将最后一行保存起来,本次处理索引-1。 Int64 size = fi.Length;//byte长度
// //头条保存起来,也不处理,本次处理索引-2。(标志是否是第一条,异步时,第一个肯定是完整的,不需要存入)
// } Int64 portion = (Int64)Math.Ceiling(size * 1.0 / length); //分成多少块
string fp2 = @filepath;
//统一使用总文件大小的内存隐射对象
using (MemoryMappedFile mmf = MemoryMappedFile.CreateFromFile(fp2, FileMode.Open, "mapname", size))
{
//从零开始,每块单独并行处理。
Parallel.For(0, portion, (index, ParallelLoopState) =>
{
//块大小和 文件总大小-第几分区位置的剩余位置,取两者较小的
Int64 fileSize = Math.Min(length, size - length * index);
if (fileSize > 0)
{
using (var accessor = mmf.CreateViewAccessor(length * index, fileSize, MemoryMappedFileAccess.Read))
{
List<string> list = new List<string>();
////每隔100是1行
//for (int i = 0; i < fileSize; i += length)
//{
//Int64 listkey = ADD();
// }
// } byte[] byteArray = new byte[length];
//}
#endregion #region 函数参数说明
//ReadArray参数
//position
//Type: System.Int64
//访问器中的字节偏移量,从此处开始读取。
//array
//Type: T[]
//包含从访问器读取的结构的数组。
//offset
//Type: System.Int32
//array 中要将第一个复制的结构放置到的索引。
//count
//Type: System.Int32
//要从访问器读取的 T 类型的结构的数目。
#region 并发用法:真正大文件时比StreamReader有用--820W行数据,439MB,转成字符串、split后,执行消耗7~8秒。 10K 1块。 //resultcount:读入 array 的结构数。 如果可用结构较少,则此值可能小于 count;如果到达访问器末尾,则为零。
#endregion
int resultcount = accessor.ReadArray(0, byteArray, 0, (int)fileSize);
//读取文件 //测试通过:\r\n \r 空格 \n(注意:\r 空格 \n 都算1个字符,\r\n算2个字符)
FileInfo fi = new FileInfo(filepath); //规则:最后必须是\n结尾,cvs的换行都是\n结尾。
Int64 size = fi.Length;//byte长度 string str = System.Text.Encoding.Default.GetString(byteArray);
int index1 = str.LastIndexOf('\n');
int length = 10240;//每次块大小 512000byte 500KB 这样1个G转2010次算完 string[] k = str.Split('\n');
//10兆字节(mb)=10485760字节(b) string endstr = null;
//UTF-8编码中,一个英文字符等于一个字节,一个中文(含繁体)等于三个字节。 本次文件中主要是英文和数字,没有中文。所以要多少字就配多大块。 if (str.Length != index1)
//50千字节(kb)=51200字节(b) {
//200千字节(kb)=204800字节(b) //不相等,最后一行不能Split分析。
Int64 portion = (Int64)Math.Ceiling(size * 1.0 / length); //分成多少块 //spilt时,将最后一行保存起来,本次处理索引-1。
//头条保存起来,也不处理,本次处理索引-2。
string fp2 = @filepath; endstr = k[k.Count() - 1].Replace("\0", string.Empty).Replace("\r", string.Empty).Trim(); ;
//统一使用总文件大小的内存隐射对象
using (MemoryMappedFile mmf = MemoryMappedFile.CreateFromFile(fp2, FileMode.Open, "mapname", size))
{
//从零开始,每块单独并行处理。
Parallel.For(0,portion,(index,ParallelLoopState)=>
{
//块大小和 文件总大小-第几分区位置的剩余位置,取两者较小的
Int64 fileSize = Math.Min(length, size - length * index);
if (fileSize > 0)
{
using (var accessor = mmf.CreateViewAccessor(length * index, fileSize, MemoryMappedFileAccess.Read))
{
List<string> list = new List<string>();
////每隔100是1行
//for (int i = 0; i < fileSize; i += length)
//{
//Int64 listkey = ADD();
byte[] byteArray = new byte[length];
#region 函数参数说明
//ReadArray参数
//position
//Type: System.Int64
//访问器中的字节偏移量,从此处开始读取。
//array
//Type: T[]
//包含从访问器读取的结构的数组。
//offset
//Type: System.Int32
//array 中要将第一个复制的结构放置到的索引。
//count
//Type: System.Int32
//要从访问器读取的 T 类型的结构的数目。
//resultcount:读入 array 的结构数。 如果可用结构较少,则此值可能小于 count;如果到达访问器末尾,则为零。
#endregion
int resultcount = accessor.ReadArray(0, byteArray, 0, (int)fileSize);
//测试通过:\r\n \r 空格 \n(注意:\r 空格 \n 都算1个字符,\r\n算2个字符)
//规则:最后必须是\n结尾,cvs的换行都是\n结尾。
string str = System.Text.Encoding.Default.GetString(byteArray);
int index1 = str.LastIndexOf('\n');
string[] k = str.Split('\n');
string endstr = null;
if (str.Length != index1)
{
//不相等,最后一行不能Split分析。
//spilt时,将最后一行保存起来,本次处理索引-1。
//头条保存起来,也不处理,本次处理索引-2。
endstr = k[k.Count() - 1].Replace("\0", string.Empty).Replace("\r", string.Empty).Trim(); ;
}
//else
//{
// //最后一行可以Split分析,不再处理
//}
} //先简化开发,将头部和尾部都另外保存。只计算中间的。然后调用ES (索引-2:从1开始,尾部-1)
//else //测试: 820W条记录,执行完毕 20~ 22秒。 最终结果3w2013条记录。有的直接点击3000多次。
//{
// //最后一行可以Split分析,不再处理
//}
//先简化开发,将头部和尾部都另外保存。只计算中间的。然后调用ES (索引-2:从1开始,尾部-1) for (int j = 1; j < k.Count() - 1; j++)
//测试: 820W条记录,执行完毕 20~ 22秒。 最终结果3w2013条记录。有的直接点击3000多次。 {
for (int j = 1; j < k.Count() - 1; j++) try
{ {
string key = k[j].Split(',')[1].Replace("\0", string.Empty).Replace("\r", string.Empty).Trim();
totalCountDic.AddOrUpdate(key, 1, (skey, scount) => { return scount = scount + 1; });
try }
{ catch (Exception ext)
string key = k[j].Split(',')[1].Replace("\0", string.Empty).Replace("\r", string.Empty).Trim(); {
totalCountDic.AddOrUpdate(key, 1, (skey, scount) => { return scount = scount + 1; }); MessageBox.Show("某行数据第2列可能为空" + ext.ToString());
} }
catch (Exception ext)
{
MessageBox.Show("某行数据第2列可能为空" + ext.ToString());
} }
} //头尾:另外保存
ListModel listmodel = new ListModel(k[0].Replace("\0", string.Empty).Replace("\r", string.Empty).Trim(), endstr);
listModelDic.TryAdd(index, listmodel);
//头尾:另外保存
ListModel listmodel = new ListModel(k[0].Replace("\0", string.Empty).Replace("\r", string.Empty).Trim(), endstr);
listModelDic.TryAdd(index, listmodel);
//}
//} }
//分区时,最后一个为0则忽略。
} }
//分区时,最后一个为0则忽略。
} });
});
} }
if (listModelDic.Count() > 0) if (listModelDic.Count() > 0)
...@@ -315,8 +239,8 @@ namespace CsvCount_ES ...@@ -315,8 +239,8 @@ namespace CsvCount_ES
try try
{ {
string key = listModelDic[1].End; string key = listModelDic[1].End;
if(!String.IsNullOrWhiteSpace(key)) if (!String.IsNullOrWhiteSpace(key))
totalCountDic.AddOrUpdate(listModelDic[1].End.Split(',')[1], 0, (skey, scount) => { return scount = scount + 1; }); totalCountDic.AddOrUpdate(listModelDic[1].End.Split(',')[1], 0, (skey, scount) => { return scount = scount + 1; });
} }
catch (Exception ext) catch (Exception ext)
{ {
...@@ -327,10 +251,10 @@ namespace CsvCount_ES ...@@ -327,10 +251,10 @@ namespace CsvCount_ES
else else
{ {
//头尾单独链式处理: 从1开始。第0行的begin 是列名称,不需要分析。 //头尾单独链式处理: 从1开始。第0行的begin 是列名称,不需要分析。
for (int i = 1; i < listModelDic.Count() ; i++) for (int i = 1; i < listModelDic.Count(); i++)
{ {
try try
{ {
//count = count + 1;//记录计算了多少次,与分块对应(其实就是与listModelDic的key-1对应即代表完整) //count = count + 1;//记录计算了多少次,与分块对应(其实就是与listModelDic的key-1对应即代表完整)
string str = ""; string str = "";
...@@ -387,111 +311,198 @@ namespace CsvCount_ES ...@@ -387,111 +311,198 @@ namespace CsvCount_ES
MessageBox.Show(ex.ToString()); MessageBox.Show(ex.ToString());
} }
#endregion
st.Stop(); #endregion
MessageBox.Show("运行时间:" + st.ElapsedMilliseconds.ToString());
#region 完整性测试---使用时注释掉。 执行效率 5-6
try }
{ else
{
MessageBox.Show("请选择文件夹!");
}
//通过一行行的输入,最终获得1个列表B,以B为左,求差集
ConcurrentDictionary<string, int> BtotalCountDic = new ConcurrentDictionary<string, int>();
#region 按行读取代码
//读取文件 #region 执行完成
label_wait.Text = "执行完毕!可以继续选择其他文件!";
this.textBox_path.Text = filePath;
//listBox1.Enabled = false;
textBox1.Enabled = true;
button1.Enabled = true;
textBox_block.Enabled = true;
Stopwatch swtp = new Stopwatch(); errorCount = 0;
swtp.Start(); count = 0;
count = 0;
StreamReader sr = new StreamReader(filepath, Encoding.Default);
String line;
line = sr.ReadLine();//第一行,头部列名称,不进入集合
while ((line = sr.ReadLine()) != null)
{
try
{
count = count + 1;//记录计算了多少次,多少行 #endregion
string key = line.Split(',')[1];
BtotalCountDic.AddOrUpdate(key, 1, (skey, scount) => { return scount = scount + 1; });
} }
catch (Exception ext)
{
MessageBox.Show("完整性测试:某行数据第2列可能为空" + ext.ToString());
}
}
swtp.Stop();
MessageBox.Show("完整性测试运行时间:" + swtp.ElapsedMilliseconds.ToString());
#endregion
//全比较 /// <summary>
var dz1 = BtotalCountDic.Except(totalCountDic); ///开发 调试 测试时使用(直接更改按钮事件):单独测试ES的方法
//key比较 /// </summary>
var dz2 = BtotalCountDic.Keys.Except(totalCountDic.Keys); /// <param name="sender"></param>
/// <param name="e"></param>
private void button2_ES_Click(object sender, EventArgs e)
{
//1.生成统计后ConcurrentDictionary
button2_Click(null, null);
if (dz1.Count() == 0 && dz2.Count() == 0) try
{ {
MessageBox.Show("两个方式结果一致"); using (FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate))
} {
else using (StreamWriter sw = new StreamWriter(fs))
{ {
MessageBox.Show("完整性测试报错"); sw.Write("[");
sw.Close();
} }
} }
catch (Exception exe1) //2.循环取得item
foreach (var temp_item in totalCountDic)
{ {
try
{
Item item_obj = ESItemAccess.SearchByItemID(temp_item.Key);
ResultItem result = new ResultItem();
result.ClickCount = temp_item.Value;
if (item_obj != null)
{
#region 能从ES中查找到值
MessageBox.Show("完整性测试" + exe1.ToString()); result.ItemID = item_obj.ItemID;
} result.Url = item_obj.Url;
result.Url = item_obj.Url;
result.CleanTitle = item_obj.CleanTitle;
result.CleanText = item_obj.CleanText;
result.PubDate = item_obj.PubDate == null ? "" : item_obj.PubDate.ToString("yyyy-MM-dd HH:mm:ss.fff");
result.MediaName = item_obj.MediaName;
result.DuplicationID = item_obj.DuplicationID;
#endregion
} //赋值 ResultItemAnalyzeData
else ResultItemAnalyzeData newdata = new ResultItemAnalyzeData();
{ foreach (ItemAnalyzeData adata in item_obj.AnalyzeData)
MessageBox.Show("请选择文件夹!"); {
} if ((!String.IsNullOrWhiteSpace(adata.IssueID)) &&
(adata.IssueID.Equals("Common") || adata.IssueID.Equals("Reader")))
{
//本次有值
if (null != adata.StockIDs)
{
//内容不需叠加
if (null == newdata.StockIDs)
{
newdata.StockIDs = adata.StockIDs;
}
//else
//{
// //内容需叠加
// newdata.StockIDs = newdata.StockIDs.Union(adata.StockIDs).ToArray<string>(); //剔除重复项
#region 执行完成 //}
label_wait.Text = "执行完毕!"; }
this.textBox_path.Text = "文件路径";
//listBox1.Enabled = false;
textBox1.Enabled = true;
button1.Enabled = true;
if (null != adata.MarketIDs)
{
int total = 0; if (null == newdata.MarketIDs)
foreach (var item in totalCountDic) {
{ newdata.MarketIDs = adata.MarketIDs;
total = total+ item.Value; }
//else
//{
// newdata.MarketIDs = newdata.MarketIDs.Union(adata.MarketIDs).ToArray<string>(); //剔除重复项
//}
}
if (null != adata.BlockIDs)
{
//内容不需叠加
if (null == newdata.BlockIDs)
{
newdata.BlockIDs = adata.BlockIDs;
}
//else
//{
// //内容需叠加
// newdata.BlockIDs = newdata.BlockIDs.Union(adata.BlockIDs).ToArray<string>(); //剔除重复项
//}
}
if (null != adata.IG)
{
if (null == newdata.IG)
{
newdata.IG = adata.IG;
}
}
}
}//end for
result.AnalyzeData = newdata;
#endregion
}
//将result结果放入到集合中。统一转为json字符串,写入文件。
string returnstr = JsonConvert.SerializeObject(result) + ",";
using (FileStream fs = new FileStream(filePath, FileMode.Append))
{
using (StreamWriter sw = new StreamWriter(fs))
{
sw.Write(returnstr);
sw.Flush();
sw.Close();
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
using (FileStream fs = new FileStream(filePath, FileMode.Append))
{
using (StreamWriter sw = new StreamWriter(fs))
{
sw.Write("]");
sw.Flush();
sw.Close();
}
}
} }
catch (Exception ext)
if (total == count)
{
MessageBox.Show("正确:点击数计算后之和" + total.ToString()+" ===文件记录总行数,"+ count.ToString());
}
else
{ {
MessageBox.Show("错误(不相等):点击数计算后之和" + total.ToString() + " !=!=!=文件记录总行数," + count.ToString());
}
total = 0;
errorCount = 0;
count = 0;
#endregion MessageBox.Show(ext.ToString());
}
}
public static long ConvertDataTimeToLong(DateTime dt)
{
DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
TimeSpan toNow = dt.Subtract(dtStart);
long timeStamp = toNow.Ticks;
//timeStamp = long.Parse(timeStamp.ToString().Substring(0, timeStamp.ToString().Length - 4));
return timeStamp;
} }
private void Form1_Load(object sender, EventArgs e)
{
}
} }
} }
using MongoDB.Bson.Serialization.Attributes;
using Nest;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CsvCount_ES
{
/// <summary>
/// 全局公用的单Item数据包
/// </summary>
[ElasticsearchType(Name = "items")]
public class Item
{
public Item()
{
}
/// <summary>
/// 文章ID
/// </summary>
public string ItemID { get; set; }
/// <summary>
/// 文章Url
/// </summary>
public string Url { get; set; }
/// <summary>
/// 标题
/// </summary>
public string CleanTitle { get; set; }
/// <summary>
/// 正文
/// </summary>
public string CleanText { get; set; }
/// <summary>
/// 页面显示发布时间
/// </summary>
[BsonDateTimeOptions(Kind = DateTimeKind.Local)]
public DateTime PubDate { get; set; }
/// <summary>
/// 媒体名称(分词索引)
/// </summary>
public string MediaName { get; set; }
/// <summary>
/// 相似转载ID(早先入库的相似文章ID,第一篇该字段为空,其他均为第一篇的ID)
/// </summary>
public string DuplicationID { get; set; }
///<summary>
///分析字段,每个客户一条记录(支持不同的分析模型)
///</summary>
[Nested(IncludeInParent = true)]//(Path = "analyzeData")]
public ItemAnalyzeData[] AnalyzeData { get; set; }
}
/// <summary>
/// 语义分析结果(每Issue可不同)
/// </summary>
[Serializable]
public class ItemAnalyzeData
{
/// <summary>
/// 议题编号
/// </summary>
public string IssueID { get; set; }
/// <summary>
/// 品类/市场编号
/// </summary>
public string[] MarketIDs { set; get; }
/// <summary>
/// 主题/板块编号
/// </summary>
public string[] BlockIDs { set; get; }
/// <summary>
/// 股票编号
/// </summary>
public string[] StockIDs { set; get; }
/// <summary>
/// IG Tree
/// </summary>
public string IG { set; get; }
public ItemAnalyzeData()
{
}
}
}
using Common.Logging;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CsvCount_ES
{
public class LogService
{
private static ILog _logdebug = LogManager.GetLogger("logdebug");
private static ILog _loginfo = LogManager.GetLogger("loginfo");
private static ILog _logwarn = LogManager.GetLogger("logwarn");
private static ILog _logerror = LogManager.GetLogger("logerror");
private static ILog _logfatal = LogManager.GetLogger("logfatal");
public static void WriteDebug(string msg)
{
StackFrame sf = new StackFrame(1);
msg = string.Format("{0}.{1}:{2}", sf.GetMethod().ReflectedType.FullName, sf.GetMethod().Name, msg);
_logdebug.Debug(msg);
}
public static void WriteDebug(string msg, Exception e)
{
StackFrame sf = new StackFrame(1);
msg = string.Format("{0}.{1}:{2}", sf.GetMethod().ReflectedType.FullName, sf.GetMethod().Name, msg);
_logdebug.Debug(msg, e);
}
public static void WriteInfo(string msg)
{
StackFrame sf = new StackFrame(1);
msg = string.Format("{0}.{1}:{2}", sf.GetMethod().ReflectedType.FullName, sf.GetMethod().Name, msg);
_loginfo.Info(msg);
}
public static void WriteInfo(string msg, Exception e)
{
StackFrame sf = new StackFrame(1);
msg = string.Format("{0}.{1}:{2}", sf.GetMethod().ReflectedType.FullName, sf.GetMethod().Name, msg);
_loginfo.Info(msg, e);
}
public static void WriteWarn(string msg)
{
StackFrame sf = new StackFrame(1);
msg = string.Format("{0}.{1}:{2}", sf.GetMethod().ReflectedType.FullName, sf.GetMethod().Name, msg);
_logwarn.Warn(msg);
}
public static void WriteWarn(string msg, Exception e)
{
StackFrame sf = new StackFrame(1);
msg = string.Format("{0}.{1}:{2}", sf.GetMethod().ReflectedType.FullName, sf.GetMethod().Name, msg);
_logwarn.Warn(msg, e);
}
public static void WriteError(string msg)
{
StackFrame sf = new StackFrame(1);
msg = string.Format("{0}.{1}:{2}", sf.GetMethod().ReflectedType.FullName, sf.GetMethod().Name, msg);
_logerror.Error(msg);
}
public static void WriteError(string msg, Exception e)
{
StackFrame sf = new StackFrame(1);
msg = string.Format("{0}.{1}:{2}", sf.GetMethod().ReflectedType.FullName, sf.GetMethod().Name, msg);
_logerror.Error(msg, e);
}
public static void WriteFatal(string msg)
{
StackFrame sf = new StackFrame(1);
msg = string.Format("{0}.{1}:{2}", sf.GetMethod().ReflectedType.FullName, sf.GetMethod().Name, msg);
_logfatal.Fatal(msg);
}
public static void WriteFatal(string msg, Exception e)
{
StackFrame sf = new StackFrame(1);
msg = string.Format("{0}.{1}:{2}", sf.GetMethod().ReflectedType.FullName, sf.GetMethod().Name, msg);
_logfatal.Fatal(msg, e);
}
}
}
//要求通过newsid=itemid(ES中的)一一对应。
//要求通过newsid=itemid(ES中的)一一对应。
//要求取得以下字段,并返回统一包装的JSON结构。(AnalyzeData只有1个,里面的数据是common+reader(两者其中有值,值也是一样的,任取其一。可能存在相互补充的情况,合并为1个。))
[
{
"ItemID": "文章ID",
"ClickCount": "点击次数",
"Url": "文章Url",
"CleanTitle": "标题",
"CleanText": "正文",
"PubDate": "页面显示发布时间",
"MediaName": "21世纪经济报道",
"DuplicationID": "相似转载ID(早先入库的相似文章ID,第一篇该字段为空,其他均为第一篇的ID)",
"AnalyzeData语义分析结果字段": {
"MarketIDs": " 品类/市场common编号reader编号:有值任取其一",
"BlockIDs": "主题/板块编号common编号,reader编号:有值任取其一",
"StockIDs": "股票编号common编号,reader编号:有值任取其一",
"IG": ""
}
}
]
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CsvCount_ES
{
public class PerformanceUtility
{
public static readonly TimeSpan DefaultTriggerTimeSpan = TimeSpan.FromMinutes(5);
public static readonly TimeSpan DefaultIntervalTimeSpan = TimeSpan.FromMinutes(2);
public static T OperationTimedMonitor<T>(TimeSpan trigger, TimeSpan interval, String message, Func<T> operation)
{
Stopwatch watch = new Stopwatch();
watch.Start();
Task<T> task = Task.Run<T>(operation);
Task waitForTrigger = Task.Delay(trigger);
Task.WaitAny(task, waitForTrigger);
if (task.IsCompleted)
{
return task.Result;
}
else
{
String guid = Guid.NewGuid().ToString();
LogService.WriteWarn(String.Format("Operation {0} timeout triggered, Message {1}, Time elasped {2}", guid, message, watch.ElapsedMilliseconds));
Task waitInterval = Task.Delay(interval);
Task.WaitAny(task, waitInterval);
while (!task.IsCompleted)
{
LogService.WriteWarn(String.Format("Operation {0} interval triggered, Time elasped {1}", guid, watch.ElapsedMilliseconds));
waitInterval = Task.Delay(interval);
Task.WaitAny(task, waitInterval);
}
return task.Result;
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CsvCount_ES.ResultModel
{
[Serializable()]
public class ResultItem
{
public ResultItem()
{
}
/// <summary>
/// 文章ID
/// </summary>
public string ItemID { get; set; }
/// <summary>
/// 点击的次数
/// </summary>
public int ClickCount { get; set; }
/// <summary>
/// 文章Url
/// </summary>
public string Url { get; set; }
/// <summary>
/// 标题
/// </summary>
public string CleanTitle { get; set; }
/// <summary>
/// 正文
/// </summary>
public string CleanText { get; set; }
/// <summary>
/// 页面显示发布时间(格式化的)
/// </summary>
public string PubDate { get; set; }
/// <summary>
/// 媒体名称(分词索引)
/// </summary>
public string MediaName { get; set; }
/// <summary>
/// 相似转载ID(早先入库的相似文章ID,第一篇该字段为空,其他均为第一篇的ID)
/// </summary>
public string DuplicationID { get; set; }
///<summary>
///合并模型
///</summary>
public ResultItemAnalyzeData AnalyzeData { get; set; }
}
/// <summary>
/// 语义分析结果(每Issue可不同)
/// </summary>
[Serializable]
public class ResultItemAnalyzeData
{
/// <summary>
/// 品类/市场编号
/// </summary>
public string[] MarketIDs { set; get; }
/// <summary>
/// 主题/板块编号
/// </summary>
public string[] BlockIDs { set; get; }
/// <summary>
/// 股票编号
/// </summary>
public string[] StockIDs { set; get; }
/// <summary>
/// IG Tree
/// </summary>
public string IG { set; get; }
public ResultItemAnalyzeData()
{
}
}
}
\ No newline at end of file
...@@ -35,6 +35,19 @@ namespace CsvCount_ES ...@@ -35,6 +35,19 @@ namespace CsvCount_ES
//if (!String.IsNullOrWhiteSpace(textBox1.Text)) //if (!String.IsNullOrWhiteSpace(textBox1.Text))
//{ //{
//Int64 length = 10240;//每次块大小 512000byte 500KB 这样1个G转2010次算完
// //10兆字节(mb)=10485760字节(b)
// //UTF-8编码中,一个英文字符等于一个字节,一个中文(含繁体)等于三个字节。 本次文件中主要是英文和数字,没有中文。所以要多少字就配多大块。
// //50千字节(kb)=51200字节(b)
// //200千字节(kb)=204800字节(b)
//if (String.IsNullOrWhiteSpace(textBox_block.Text) || !Int64.TryParse(textBox_block.Text, out length))
//{
// MessageBox.Show("请正确输入分块并行读取(B)");
// return;
//}
// #region 执行内存映射方案 // #region 执行内存映射方案
// label_wait.Text = "正在执行分析,请耐心等待........!"; // label_wait.Text = "正在执行分析,请耐心等待........!";
...@@ -74,7 +87,7 @@ namespace CsvCount_ES ...@@ -74,7 +87,7 @@ namespace CsvCount_ES
// //int offset = 0; // //int offset = 0;
// //int length = 512000;//每次块大小 512000byte 500KB 这样1个G转2010次算完
// ////UTF-8编码中,一个英文字符等于一个字节,一个中文(含繁体)等于三个字节。 本次文件中主要是英文和数字,没有中文。所以要多少字就配多大块。 // ////UTF-8编码中,一个英文字符等于一个字节,一个中文(含繁体)等于三个字节。 本次文件中主要是英文和数字,没有中文。所以要多少字就配多大块。
// //string fp2 = @filepath; // //string fp2 = @filepath;
// //using (MemoryMappedFile mmf = MemoryMappedFile.CreateFromFile(fp2, FileMode.Open, "mapname")) // //using (MemoryMappedFile mmf = MemoryMappedFile.CreateFromFile(fp2, FileMode.Open, "mapname"))
...@@ -416,7 +429,7 @@ namespace CsvCount_ES ...@@ -416,7 +429,7 @@ namespace CsvCount_ES
////listBox1.Enabled = false; ////listBox1.Enabled = false;
//textBox1.Enabled = true; //textBox1.Enabled = true;
//button1.Enabled = true; //button1.Enabled = true;
//textBox_block.Enabled = true;
//int total = 0; //int total = 0;
//foreach (var item in totalCountDic) //foreach (var item in totalCountDic)
......
<?xml version="1.0"?>
<doc>
<assembly>
<name>Common.Logging.Core</name>
</assembly>
<members>
<member name="T:Common.Logging.Factory.StringFormatMethodAttribute">
<summary>
Indicates that the marked method builds string by format pattern and (optional) arguments.
Parameter, which contains format string, should be given in constructor. The format string
should be in <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/>-like form
</summary>
<example><code>
[StringFormatMethod("message")]
public void ShowError(string message, params object[] args) { /* do something */ }
public void Foo() {
ShowError("Failed: {0}"); // Warning: Non-existing argument in format string
}
</code></example>
</member>
<member name="M:Common.Logging.Factory.StringFormatMethodAttribute.#ctor(System.String)">
<param name="formatParameterName">
Specifies which parameter of an annotated method should be treated as format-string
</param>
</member>
<member name="P:Common.Logging.Factory.StringFormatMethodAttribute.FormatParameterName">
<summary>
The name of the string parameter being formatted
</summary>
</member>
<member name="T:Common.Logging.FormatMessageHandler">
<summary>
The type of method that is passed into e.g. <see cref="M:Common.Logging.ILog.Debug(System.Action{Common.Logging.FormatMessageHandler})"/>
and allows the callback method to "submit" it's message to the underlying output system.
</summary>
<param name="format">the format argument as in <see cref="M:System.String.Format(System.String,System.Object[])"/></param>
<param name="args">the argument list as in <see cref="M:System.String.Format(System.String,System.Object[])"/></param>
<seealso cref="T:Common.Logging.ILog"/>
<author>Erich Eichinger</author>
</member>
<member name="T:Common.Logging.IConfigurationReader">
<summary>
Interface for basic operations to read .NET application configuration information.
</summary>
<remarks>Provides a simple abstraction to handle BCL API differences between .NET 1.x and 2.0. Also
useful for testing scenarios.</remarks>
<author>Mark Pollack</author>
</member>
<member name="M:Common.Logging.IConfigurationReader.GetSection(System.String)">
<summary>
Parses the configuration section and returns the resulting object.
</summary>
<remarks>
<p>
Primary purpose of this method is to allow us to parse and
load configuration sections using the same API regardless
of the .NET framework version.
</p>
See also <c>System.Configuration.ConfigurationManager</c>
</remarks>
<param name="sectionName">Name of the configuration section.</param>
<returns>Object created by a corresponding IConfigurationSectionHandler.</returns>
</member>
<member name="T:Common.Logging.ILog">
<summary>
A simple logging interface abstracting logging APIs.
</summary>
<remarks>
<para>
Implementations should defer calling a message's <see cref="M:System.Object.ToString"/> until the message really needs
to be logged to avoid performance penalties.
</para>
<para>
Each <see cref="T:Common.Logging.ILog"/> log method offers to pass in a <see cref="T:System.Action`1"/> instead of the actual message.
Using this style has the advantage to defer possibly expensive message argument evaluation and formatting (and formatting arguments!) until the message gets
actually logged. If the message is not logged at all (e.g. due to <see cref="T:Common.Logging.LogLevel"/> settings),
you won't have to pay the peformance penalty of creating the message.
</para>
</remarks>
<example>
The example below demonstrates using callback style for creating the message, where the call to the
<see cref="M:System.Random.NextDouble"/> and the underlying <see cref="M:System.String.Format(System.String,System.Object[])"/> only happens, if level <see cref="F:Common.Logging.LogLevel.Debug"/> is enabled:
<code>
Log.Debug( m=&gt;m(&quot;result is {0}&quot;, random.NextDouble()) );
Log.Debug(delegate(m) { m(&quot;result is {0}&quot;, random.NextDouble()); });
</code>
</example>
<seealso cref="T:System.Action`1"/>
<author>Mark Pollack</author>
<author>Bruno Baia</author>
<author>Erich Eichinger</author>
</member>
<member name="M:Common.Logging.ILog.Trace(System.Object)">
<summary>
Log a message object with the <see cref="F:Common.Logging.LogLevel.Trace"/> level.
</summary>
<param name="message">The message object to log.</param>
</member>
<member name="M:Common.Logging.ILog.Trace(System.Object,System.Exception)">
<summary>
Log a message object with the <see cref="F:Common.Logging.LogLevel.Trace"/> level including
the stack trace of the <see cref="T:System.Exception"/> passed
as a parameter.
</summary>
<param name="message">The message object to log.</param>
<param name="exception">The exception to log, including its stack trace.</param>
</member>
<member name="M:Common.Logging.ILog.TraceFormat(System.String,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Trace"/> level.
</summary>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="args">the list of format arguments</param>
</member>
<member name="M:Common.Logging.ILog.TraceFormat(System.String,System.Exception,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Trace"/> level.
</summary>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="exception">The exception to log.</param>
<param name="args">the list of format arguments</param>
</member>
<member name="M:Common.Logging.ILog.TraceFormat(System.IFormatProvider,System.String,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Trace"/> level.
</summary>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="args"></param>
</member>
<member name="M:Common.Logging.ILog.TraceFormat(System.IFormatProvider,System.String,System.Exception,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Trace"/> level.
</summary>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="exception">The exception to log.</param>
<param name="args"></param>
</member>
<member name="M:Common.Logging.ILog.Trace(System.Action{Common.Logging.FormatMessageHandler})">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Trace"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
</member>
<member name="M:Common.Logging.ILog.Trace(System.Action{Common.Logging.FormatMessageHandler},System.Exception)">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Trace"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
<param name="exception">The exception to log, including its stack trace.</param>
</member>
<member name="M:Common.Logging.ILog.Trace(System.IFormatProvider,System.Action{Common.Logging.FormatMessageHandler})">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Trace"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
</member>
<member name="M:Common.Logging.ILog.Trace(System.IFormatProvider,System.Action{Common.Logging.FormatMessageHandler},System.Exception)">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Trace"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
<param name="exception">The exception to log, including its stack trace.</param>
</member>
<member name="M:Common.Logging.ILog.Debug(System.Object)">
<summary>
Log a message object with the <see cref="F:Common.Logging.LogLevel.Debug"/> level.
</summary>
<param name="message">The message object to log.</param>
</member>
<member name="M:Common.Logging.ILog.Debug(System.Object,System.Exception)">
<summary>
Log a message object with the <see cref="F:Common.Logging.LogLevel.Debug"/> level including
the stack trace of the <see cref="T:System.Exception"/> passed
as a parameter.
</summary>
<param name="message">The message object to log.</param>
<param name="exception">The exception to log, including its stack trace.</param>
</member>
<member name="M:Common.Logging.ILog.DebugFormat(System.String,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Debug"/> level.
</summary>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="args">the list of format arguments</param>
</member>
<member name="M:Common.Logging.ILog.DebugFormat(System.String,System.Exception,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Debug"/> level.
</summary>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="exception">The exception to log.</param>
<param name="args">the list of format arguments</param>
</member>
<member name="M:Common.Logging.ILog.DebugFormat(System.IFormatProvider,System.String,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Debug"/> level.
</summary>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="args"></param>
</member>
<member name="M:Common.Logging.ILog.DebugFormat(System.IFormatProvider,System.String,System.Exception,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Debug"/> level.
</summary>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="exception">The exception to log.</param>
<param name="args"></param>
</member>
<member name="M:Common.Logging.ILog.Debug(System.Action{Common.Logging.FormatMessageHandler})">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Debug"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
</member>
<member name="M:Common.Logging.ILog.Debug(System.Action{Common.Logging.FormatMessageHandler},System.Exception)">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Debug"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
<param name="exception">The exception to log, including its stack trace.</param>
</member>
<member name="M:Common.Logging.ILog.Debug(System.IFormatProvider,System.Action{Common.Logging.FormatMessageHandler})">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Debug"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
</member>
<member name="M:Common.Logging.ILog.Debug(System.IFormatProvider,System.Action{Common.Logging.FormatMessageHandler},System.Exception)">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Debug"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
<param name="exception">The exception to log, including its stack Debug.</param>
</member>
<member name="M:Common.Logging.ILog.Info(System.Object)">
<summary>
Log a message object with the <see cref="F:Common.Logging.LogLevel.Info"/> level.
</summary>
<param name="message">The message object to log.</param>
</member>
<member name="M:Common.Logging.ILog.Info(System.Object,System.Exception)">
<summary>
Log a message object with the <see cref="F:Common.Logging.LogLevel.Info"/> level including
the stack trace of the <see cref="T:System.Exception"/> passed
as a parameter.
</summary>
<param name="message">The message object to log.</param>
<param name="exception">The exception to log, including its stack trace.</param>
</member>
<member name="M:Common.Logging.ILog.InfoFormat(System.String,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Info"/> level.
</summary>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="args">the list of format arguments</param>
</member>
<member name="M:Common.Logging.ILog.InfoFormat(System.String,System.Exception,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Info"/> level.
</summary>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="exception">The exception to log.</param>
<param name="args">the list of format arguments</param>
</member>
<member name="M:Common.Logging.ILog.InfoFormat(System.IFormatProvider,System.String,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Info"/> level.
</summary>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="args"></param>
</member>
<member name="M:Common.Logging.ILog.InfoFormat(System.IFormatProvider,System.String,System.Exception,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Info"/> level.
</summary>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="exception">The exception to log.</param>
<param name="args"></param>
</member>
<member name="M:Common.Logging.ILog.Info(System.Action{Common.Logging.FormatMessageHandler})">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Info"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
</member>
<member name="M:Common.Logging.ILog.Info(System.Action{Common.Logging.FormatMessageHandler},System.Exception)">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Info"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
<param name="exception">The exception to log, including its stack trace.</param>
</member>
<member name="M:Common.Logging.ILog.Info(System.IFormatProvider,System.Action{Common.Logging.FormatMessageHandler})">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Info"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
</member>
<member name="M:Common.Logging.ILog.Info(System.IFormatProvider,System.Action{Common.Logging.FormatMessageHandler},System.Exception)">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Info"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
<param name="exception">The exception to log, including its stack Info.</param>
</member>
<member name="M:Common.Logging.ILog.Warn(System.Object)">
<summary>
Log a message object with the <see cref="F:Common.Logging.LogLevel.Warn"/> level.
</summary>
<param name="message">The message object to log.</param>
</member>
<member name="M:Common.Logging.ILog.Warn(System.Object,System.Exception)">
<summary>
Log a message object with the <see cref="F:Common.Logging.LogLevel.Warn"/> level including
the stack trace of the <see cref="T:System.Exception"/> passed
as a parameter.
</summary>
<param name="message">The message object to log.</param>
<param name="exception">The exception to log, including its stack trace.</param>
</member>
<member name="M:Common.Logging.ILog.WarnFormat(System.String,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Warn"/> level.
</summary>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="args">the list of format arguments</param>
</member>
<member name="M:Common.Logging.ILog.WarnFormat(System.String,System.Exception,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Warn"/> level.
</summary>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="exception">The exception to log.</param>
<param name="args">the list of format arguments</param>
</member>
<member name="M:Common.Logging.ILog.WarnFormat(System.IFormatProvider,System.String,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Warn"/> level.
</summary>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="args"></param>
</member>
<member name="M:Common.Logging.ILog.WarnFormat(System.IFormatProvider,System.String,System.Exception,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Warn"/> level.
</summary>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="exception">The exception to log.</param>
<param name="args"></param>
</member>
<member name="M:Common.Logging.ILog.Warn(System.Action{Common.Logging.FormatMessageHandler})">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Warn"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
</member>
<member name="M:Common.Logging.ILog.Warn(System.Action{Common.Logging.FormatMessageHandler},System.Exception)">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Warn"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
<param name="exception">The exception to log, including its stack trace.</param>
</member>
<member name="M:Common.Logging.ILog.Warn(System.IFormatProvider,System.Action{Common.Logging.FormatMessageHandler})">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Warn"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
</member>
<member name="M:Common.Logging.ILog.Warn(System.IFormatProvider,System.Action{Common.Logging.FormatMessageHandler},System.Exception)">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Warn"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
<param name="exception">The exception to log, including its stack Warn.</param>
</member>
<member name="M:Common.Logging.ILog.Error(System.Object)">
<summary>
Log a message object with the <see cref="F:Common.Logging.LogLevel.Error"/> level.
</summary>
<param name="message">The message object to log.</param>
</member>
<member name="M:Common.Logging.ILog.Error(System.Object,System.Exception)">
<summary>
Log a message object with the <see cref="F:Common.Logging.LogLevel.Error"/> level including
the stack trace of the <see cref="T:System.Exception"/> passed
as a parameter.
</summary>
<param name="message">The message object to log.</param>
<param name="exception">The exception to log, including its stack trace.</param>
</member>
<member name="M:Common.Logging.ILog.ErrorFormat(System.String,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Error"/> level.
</summary>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="args">the list of format arguments</param>
</member>
<member name="M:Common.Logging.ILog.ErrorFormat(System.String,System.Exception,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Error"/> level.
</summary>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="exception">The exception to log.</param>
<param name="args">the list of format arguments</param>
</member>
<member name="M:Common.Logging.ILog.ErrorFormat(System.IFormatProvider,System.String,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Error"/> level.
</summary>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="args"></param>
</member>
<member name="M:Common.Logging.ILog.ErrorFormat(System.IFormatProvider,System.String,System.Exception,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Error"/> level.
</summary>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="exception">The exception to log.</param>
<param name="args"></param>
</member>
<member name="M:Common.Logging.ILog.Error(System.Action{Common.Logging.FormatMessageHandler})">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Error"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
</member>
<member name="M:Common.Logging.ILog.Error(System.Action{Common.Logging.FormatMessageHandler},System.Exception)">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Error"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
<param name="exception">The exception to log, including its stack trace.</param>
</member>
<member name="M:Common.Logging.ILog.Error(System.IFormatProvider,System.Action{Common.Logging.FormatMessageHandler})">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Error"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
</member>
<member name="M:Common.Logging.ILog.Error(System.IFormatProvider,System.Action{Common.Logging.FormatMessageHandler},System.Exception)">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Error"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
<param name="exception">The exception to log, including its stack Error.</param>
</member>
<member name="M:Common.Logging.ILog.Fatal(System.Object)">
<summary>
Log a message object with the <see cref="F:Common.Logging.LogLevel.Fatal"/> level.
</summary>
<param name="message">The message object to log.</param>
</member>
<member name="M:Common.Logging.ILog.Fatal(System.Object,System.Exception)">
<summary>
Log a message object with the <see cref="F:Common.Logging.LogLevel.Fatal"/> level including
the stack trace of the <see cref="T:System.Exception"/> passed
as a parameter.
</summary>
<param name="message">The message object to log.</param>
<param name="exception">The exception to log, including its stack trace.</param>
</member>
<member name="M:Common.Logging.ILog.FatalFormat(System.String,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Fatal"/> level.
</summary>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="args">the list of format arguments</param>
</member>
<member name="M:Common.Logging.ILog.FatalFormat(System.String,System.Exception,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Fatal"/> level.
</summary>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="exception">The exception to log.</param>
<param name="args">the list of format arguments</param>
</member>
<member name="M:Common.Logging.ILog.FatalFormat(System.IFormatProvider,System.String,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Fatal"/> level.
</summary>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="args"></param>
</member>
<member name="M:Common.Logging.ILog.FatalFormat(System.IFormatProvider,System.String,System.Exception,System.Object[])">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Fatal"/> level.
</summary>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="format">The format of the message object to log.<see cref="M:System.String.Format(System.String,System.Object[])"/> </param>
<param name="exception">The exception to log.</param>
<param name="args"></param>
</member>
<member name="M:Common.Logging.ILog.Fatal(System.Action{Common.Logging.FormatMessageHandler})">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Fatal"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
</member>
<member name="M:Common.Logging.ILog.Fatal(System.Action{Common.Logging.FormatMessageHandler},System.Exception)">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Fatal"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
<param name="exception">The exception to log, including its stack trace.</param>
</member>
<member name="M:Common.Logging.ILog.Fatal(System.IFormatProvider,System.Action{Common.Logging.FormatMessageHandler})">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Fatal"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
</member>
<member name="M:Common.Logging.ILog.Fatal(System.IFormatProvider,System.Action{Common.Logging.FormatMessageHandler},System.Exception)">
<summary>
Log a message with the <see cref="F:Common.Logging.LogLevel.Fatal"/> level using a callback to obtain the message
</summary>
<remarks>
Using this method avoids the cost of creating a message and evaluating message arguments
that probably won't be logged due to loglevel settings.
</remarks>
<param name="formatProvider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
<param name="formatMessageCallback">A callback used by the logger to obtain the message if log level is matched</param>
<param name="exception">The exception to log, including its stack Fatal.</param>
</member>
<member name="P:Common.Logging.ILog.IsTraceEnabled">
<summary>
Checks if this logger is enabled for the <see cref="F:Common.Logging.LogLevel.Trace"/> level.
</summary>
</member>
<member name="P:Common.Logging.ILog.IsDebugEnabled">
<summary>
Checks if this logger is enabled for the <see cref="F:Common.Logging.LogLevel.Debug"/> level.
</summary>
</member>
<member name="P:Common.Logging.ILog.IsErrorEnabled">
<summary>
Checks if this logger is enabled for the <see cref="F:Common.Logging.LogLevel.Error"/> level.
</summary>
</member>
<member name="P:Common.Logging.ILog.IsFatalEnabled">
<summary>
Checks if this logger is enabled for the <see cref="F:Common.Logging.LogLevel.Fatal"/> level.
</summary>
</member>
<member name="P:Common.Logging.ILog.IsInfoEnabled">
<summary>
Checks if this logger is enabled for the <see cref="F:Common.Logging.LogLevel.Info"/> level.
</summary>
</member>
<member name="P:Common.Logging.ILog.IsWarnEnabled">
<summary>
Checks if this logger is enabled for the <see cref="F:Common.Logging.LogLevel.Warn"/> level.
</summary>
</member>
<member name="P:Common.Logging.ILog.GlobalVariablesContext">
<summary>
Returns the global context for variables
</summary>
</member>
<member name="P:Common.Logging.ILog.ThreadVariablesContext">
<summary>
Returns the thread-specific context for variables
</summary>
</member>
<member name="P:Common.Logging.ILog.NestedThreadVariablesContext">
<summary>
Returns the thread-specific context for nested variables (for NDC, eg.)
</summary>
</member>
<member name="T:Common.Logging.ILoggerFactoryAdapter">
<summary>
LoggerFactoryAdapter interface is used internally by LogManager
Only developers wishing to write new Common.Logging adapters need to
worry about this interface.
</summary>
<author>Gilles Bayon</author>
</member>
<member name="M:Common.Logging.ILoggerFactoryAdapter.GetLogger(System.Type)">
<summary>
Get a ILog instance by type.
</summary>
<param name="type">The type to use for the logger</param>
<returns></returns>
</member>
<member name="M:Common.Logging.ILoggerFactoryAdapter.GetLogger(System.String)">
<summary>
Get a ILog instance by key.
</summary>
<param name="key">The key of the logger</param>
<returns></returns>
</member>
<member name="T:Common.Logging.ILogManager">
<summary>
Interface for LogManager
</summary>
</member>
<member name="P:Common.Logging.ILogManager.COMMON_LOGGING_SECTION">
<summary>
The key of the default configuration section to read settings from.
</summary>
<remarks>
You can always change the source of your configuration settings by setting another <see cref="T:Common.Logging.IConfigurationReader"/> instance
on <see cref="P:Common.Logging.ILogManager.ConfigurationReader"/>.
</remarks>
</member>
<member name="M:Common.Logging.ILogManager.Reset">
<summary>
Reset the <see cref="N:Common.Logging" /> infrastructure to its default settings. This means, that configuration settings
will be re-read from section <c>&lt;common/logging&gt;</c> of your <c>app.config</c>.
</summary>
<remarks>
This is mainly used for unit testing, you wouldn't normally use this in your applications.<br/>
<b>Note:</b><see cref="T:Common.Logging.ILog"/> instances already handed out from this LogManager are not(!) affected.
Resetting LogManager only affects new instances being handed out.
</remarks>
</member>
<member name="M:Common.Logging.ILogManager.Reset(Common.Logging.IConfigurationReader)">
<summary>
Reset the <see cref="N:Common.Logging" /> infrastructure to its default settings. This means, that configuration settings
will be re-read from section <c>&lt;common/logging&gt;</c> of your <c>app.config</c>.
</summary>
<remarks>
This is mainly used for unit testing, you wouldn't normally use this in your applications.<br/>
<b>Note:</b><see cref="T:Common.Logging.ILog"/> instances already handed out from this LogManager are not(!) affected.
Resetting LogManager only affects new instances being handed out.
</remarks>
<param name="reader">
the <see cref="T:Common.Logging.IConfigurationReader"/> instance to obtain settings for
re-initializing the LogManager.
</param>
</member>
<member name="P:Common.Logging.ILogManager.ConfigurationReader">
<summary>
Gets the configuration reader used to initialize the LogManager.
</summary>
<remarks>Primarily used for testing purposes but maybe useful to obtain configuration
information from some place other than the .NET application configuration file.</remarks>
<value>The configuration reader.</value>
</member>
<member name="P:Common.Logging.ILogManager.Adapter">
<summary>
Gets or sets the adapter.
</summary>
<value>The adapter.</value>
</member>
<member name="M:Common.Logging.ILogManager.GetCurrentClassLogger">
<summary>
Gets the logger by calling <see cref="M:Common.Logging.ILoggerFactoryAdapter.GetLogger(System.Type)"/>
on the currently configured <see cref="P:Common.Logging.ILogManager.Adapter"/> using the type of the calling class.
</summary>
<remarks>
This method needs to inspect the StackTrace in order to determine the calling
class. This of course comes with a performance penalty, thus you shouldn't call it too
often in your application.
</remarks>
<seealso cref="M:Common.Logging.ILogManager.GetLogger(System.Type)"/>
<returns>the logger instance obtained from the current <see cref="P:Common.Logging.ILogManager.Adapter"/></returns>
</member>
<member name="M:Common.Logging.ILogManager.GetLogger``1">
<summary>
Gets the logger by calling <see cref="M:Common.Logging.ILoggerFactoryAdapter.GetLogger(System.Type)"/>
on the currently configured <see cref="P:Common.Logging.ILogManager.Adapter"/> using the specified type.
</summary>
<returns>the logger instance obtained from the current <see cref="P:Common.Logging.ILogManager.Adapter"/></returns>
</member>
<member name="M:Common.Logging.ILogManager.GetLogger(System.Type)">
<summary>
Gets the logger by calling <see cref="M:Common.Logging.ILoggerFactoryAdapter.GetLogger(System.Type)"/>
on the currently configured <see cref="P:Common.Logging.ILogManager.Adapter"/> using the specified type.
</summary>
<param name="type">The type.</param>
<returns>the logger instance obtained from the current <see cref="P:Common.Logging.ILogManager.Adapter"/></returns>
</member>
<member name="M:Common.Logging.ILogManager.GetLogger(System.String)">
<summary>
Gets the logger by calling <see cref="M:Common.Logging.ILoggerFactoryAdapter.GetLogger(System.String)"/>
on the currently configured <see cref="P:Common.Logging.ILogManager.Adapter"/> using the specified key.
</summary>
<param name="key">The key.</param>
<returns>the logger instance obtained from the current <see cref="P:Common.Logging.ILogManager.Adapter"/></returns>
</member>
<member name="T:Common.Logging.INestedVariablesContext">
<summary>
A context for logger variables
</summary>
</member>
<member name="M:Common.Logging.INestedVariablesContext.Push(System.String)">
<summary>Pushes a new context message into this stack.</summary>
<param name="text">The new context message text.</param>
<returns>
An <see cref="T:System.IDisposable" /> that can be used to clean up the context stack.
</returns>
</member>
<member name="M:Common.Logging.INestedVariablesContext.Pop">
<summary>Removes the top context from this stack.</summary>
<returns>The message in the context that was removed from the top of this stack.</returns>
</member>
<member name="M:Common.Logging.INestedVariablesContext.Clear">
<summary>
Remove all items from nested context
</summary>
</member>
<member name="P:Common.Logging.INestedVariablesContext.HasItems">
<summary>
Returns true if there is at least one item in the nested context; false, if empty
</summary>
</member>
<member name="T:Common.Logging.IVariablesContext">
<summary>
A context for logger variables
</summary>
</member>
<member name="M:Common.Logging.IVariablesContext.Set(System.String,System.Object)">
<summary>
Sets the value of a new or existing variable within the context
</summary>
<param name="key">The key of the variable that is to be added</param>
<param name="value">The value to add</param>
</member>
<member name="M:Common.Logging.IVariablesContext.Get(System.String)">
<summary>
Gets the value of a variable within the context
</summary>
<param name="key">The key of the variable to get</param>
<returns>The value or null if not found</returns>
</member>
<member name="M:Common.Logging.IVariablesContext.Contains(System.String)">
<summary>
Checks if a variable is set within the context
</summary>
<param name="key">The key of the variable to check for</param>
<returns>True if the variable is set</returns>
</member>
<member name="M:Common.Logging.IVariablesContext.Remove(System.String)">
<summary>
Removes a variable from the context by key
</summary>
<param name="key">The key of the variable to remove</param>
</member>
<member name="M:Common.Logging.IVariablesContext.Clear">
<summary>
Clears the context variables
</summary>
</member>
<member name="T:Common.Logging.LogLevel">
<summary>
The 7 possible logging levels
</summary>
<author>Gilles Bayon</author>
</member>
<member name="F:Common.Logging.LogLevel.All">
<summary>
All logging levels
</summary>
</member>
<member name="F:Common.Logging.LogLevel.Trace">
<summary>
A trace logging level
</summary>
</member>
<member name="F:Common.Logging.LogLevel.Debug">
<summary>
A debug logging level
</summary>
</member>
<member name="F:Common.Logging.LogLevel.Info">
<summary>
A info logging level
</summary>
</member>
<member name="F:Common.Logging.LogLevel.Warn">
<summary>
A warn logging level
</summary>
</member>
<member name="F:Common.Logging.LogLevel.Error">
<summary>
An error logging level
</summary>
</member>
<member name="F:Common.Logging.LogLevel.Fatal">
<summary>
A fatal logging level
</summary>
</member>
<member name="F:Common.Logging.LogLevel.Off">
<summary>
Do not log anything.
</summary>
</member>
</members>
</doc>
<?xml version="1.0"?>
<doc>
<assembly>
<name>Common.Logging.Log4Net208</name>
</assembly>
<members>
<member name="T:Common.Logging.Log4Net.CommonLoggingAppender">
<summary>
Routes log events to Common.Logging infrastructure.
</summary>
<example>
To route all events logged using log4net to Common.Logging, you need to configure this appender as shown below:
<code>
&lt;log4net&gt;
&lt;appender name=&quot;CommonLoggingAppender&quot;
type=&quot;Common.Logging.Log4Net.CommonLoggingAppender, Common.Logging.Log4Net129&quot;&gt;
&lt;layout type=&quot;log4net.Layout.PatternLayout, log4net&quot;&gt;
&lt;param name=&quot;ConversionPattern&quot; value=&quot;%level - %class.%method: %message&quot; /&gt;
&lt;/layout&gt;
&lt;/appender&gt;
&lt;root&gt;
&lt;level value=&quot;ALL&quot; /&gt;
&lt;appender-ref ref=&quot;CommonLoggingAppender&quot; /&gt;
&lt;/root&gt;
&lt;/log4net&gt;
</code>
</example>
<author>Erich Eichinger</author>
</member>
<member name="T:Common.Logging.Log4Net.CommonLoggingAppender.ExceptionAwareLayout">
<summary>
Wrapper class that prevents exceptions from being rendered in the message
</summary>
</member>
<member name="M:Common.Logging.Log4Net.CommonLoggingAppender.GetClosestLevel(log4net.Core.Level)">
<summary>
Gets the closest level supported by Common.Logging of the given log4net level
</summary>
</member>
<member name="P:Common.Logging.Log4Net.CommonLoggingAppender.Layout">
<summary>
Get or set the layout for this appender
</summary>
</member>
<member name="M:Common.Logging.Log4Net.CommonLoggingAppender.Append(log4net.Core.LoggingEvent)">
<summary>
Sends the given log event to Common.Logging
</summary>
</member>
<member name="T:Common.Logging.Log4Net.Log4NetGlobalVariablesContext">
<summary>
A global context for logger variables
</summary>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetGlobalVariablesContext.Set(System.String,System.Object)">
<summary>
Sets the value of a new or existing variable within the global context
</summary>
<param name="key">The key of the variable that is to be added</param>
<param name="value">The value to add</param>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetGlobalVariablesContext.Get(System.String)">
<summary>
Gets the value of a variable within the global context
</summary>
<param name="key">The key of the variable to get</param>
<returns>The value or null if not found</returns>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetGlobalVariablesContext.Contains(System.String)">
<summary>
Checks if a variable is set within the global context
</summary>
<param name="key">The key of the variable to check for</param>
<returns>True if the variable is set</returns>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetGlobalVariablesContext.Remove(System.String)">
<summary>
Removes a variable from the global context by key
</summary>
<param name="key">The key of the variable to remove</param>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetGlobalVariablesContext.Clear">
<summary>
Clears the global context variables
</summary>
</member>
<member name="T:Common.Logging.Log4Net.Log4NetLogger">
<summary>
Concrete implementation of <see cref="T:Common.Logging.ILog"/> interface specific to log4net 1.2.9-1.2.11.
</summary>
<remarks>
Log4net is capable of outputting extended debug information about where the current
message was generated: class name, method name, file, line, etc. Log4net assumes that the location
information should be gathered relative to where Debug() was called.
When using Common.Logging, Debug() is called in Common.Logging.Log4Net.Log4NetLogger. This means that
the location information will indicate that Common.Logging.Log4Net.Log4NetLogger always made
the call to Debug(). We need to know where Common.Logging.ILog.Debug()
was called. To do this we need to use the log4net.ILog.Logger.Log method and pass in a Type telling
log4net where in the stack to begin looking for location information.
</remarks>
<author>Gilles Bayon</author>
<author>Erich Eichinger</author>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetLogger.#ctor(log4net.Core.ILoggerWrapper)">
<summary>
Constructor
</summary>
<param name="log"></param>
</member>
<member name="P:Common.Logging.Log4Net.Log4NetLogger.IsTraceEnabled">
<summary>
</summary>
</member>
<member name="P:Common.Logging.Log4Net.Log4NetLogger.IsDebugEnabled">
<summary>
</summary>
</member>
<member name="P:Common.Logging.Log4Net.Log4NetLogger.IsInfoEnabled">
<summary>
</summary>
</member>
<member name="P:Common.Logging.Log4Net.Log4NetLogger.IsWarnEnabled">
<summary>
</summary>
</member>
<member name="P:Common.Logging.Log4Net.Log4NetLogger.IsErrorEnabled">
<summary>
</summary>
</member>
<member name="P:Common.Logging.Log4Net.Log4NetLogger.IsFatalEnabled">
<summary>
</summary>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetLogger.WriteInternal(Common.Logging.LogLevel,System.Object,System.Exception)">
<summary>
Actually sends the message to the underlying log system.
</summary>
<param name="logLevel">the level of this log event.</param>
<param name="message">the message to log</param>
<param name="exception">the exception to log (may be null)</param>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetLogger.GetLevel(Common.Logging.LogLevel)">
<summary>
Maps <see cref="T:Common.Logging.LogLevel"/> to log4net's <see cref="T:log4net.Core.Level"/>
</summary>
<param name="logLevel"></param>
</member>
<member name="P:Common.Logging.Log4Net.Log4NetLogger.GlobalVariablesContext">
<summary>
Returns the global context for variables
</summary>
</member>
<member name="P:Common.Logging.Log4Net.Log4NetLogger.ThreadVariablesContext">
<summary>
Returns the thread-specific context for variables
</summary>
</member>
<member name="P:Common.Logging.Log4Net.Log4NetLogger.NestedThreadVariablesContext">
<summary>
</summary>
</member>
<member name="T:Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter">
<summary>
Concrete subclass of ILoggerFactoryAdapter specific to log4net 1.2.9-1.2.11.
</summary>
<remarks>
The following configuration property values may be configured:
<list type="bullet">
<item><c>configType</c>: <c>INLINE|FILE|FILE-WATCH|EXTERNAL</c></item>
<item><c>configFile</c>: log4net configuration file path in case of FILE or FILE-WATCH</item>
</list>
The configType values have the following implications:
<list type="bullet">
<item>INLINE: simply calls <c>XmlConfigurator.Configure()</c></item>
<item>FILE: calls <c>XmlConfigurator.Configure(System.IO.FileInfo)</c> using <c>configFile</c>.</item>
<item>FILE-WATCH: calls <c>XmlConfigurator.ConfigureAndWatch(System.IO.FileInfo)</c> using <c>configFile</c>.</item>
<item>EXTERNAL: does nothing and expects log4net to be configured elsewhere.</item>
<item>&lt;any&gt;: calls <c>BasicConfigurator.Configure()</c></item>
</list>
</remarks>
<example>
The following snippet shows an example of how to configure log4net with Common.Logging:
<code>
&lt;configuration&gt;
&lt;configSections&gt;
&lt;sectionGroup name=&quot;common&quot;&gt;
&lt;section name=&quot;logging&quot;
type=&quot;Common.Logging.ConfigurationSectionHandler, Common.Logging&quot;
requirePermission=&quot;false&quot; /&gt;
&lt;/sectionGroup&gt;
&lt;section name=&quot;log4net&quot;
type=&quot;log4net.Config.Log4NetConfigurationSectionHandler&quot;
requirePermission=&quot;false&quot; /&gt;
&lt;/configSections&gt;
&lt;common&gt;
&lt;logging&gt;
&lt;factoryAdapter type=&quot;Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4Net129&quot;&gt;
&lt;arg key=&quot;level&quot; value=&quot;ALL&quot; /&gt;
&lt;arg key=&quot;configType&quot; value=&quot;INLINE&quot; /&gt;
&lt;/factoryAdapter&gt;
&lt;/logging&gt;
&lt;/common&gt;
&lt;log4net debug=&quot;false&quot;&gt;
&lt;appender name=&quot;RollingLogFileAppender&quot; type=&quot;log4net.Appender.RollingFileAppender, log4net&quot;&gt;
&lt;param name=&quot;File&quot; value=&quot;./Web.log&quot; /&gt;
&lt;param name=&quot;AppendToFile&quot; value=&quot;true&quot; /&gt;
&lt;param name=&quot;MaxSizeRollBackups&quot; value=&quot;1&quot; /&gt;
&lt;param name=&quot;MaximumFileSize&quot; value=&quot;1GB&quot; /&gt;
&lt;param name=&quot;RollingStyle&quot; value=&quot;Date&quot; /&gt;
&lt;param name=&quot;StaticLogFileName&quot; value=&quot;false&quot; /&gt;
&lt;layout type=&quot;log4net.Layout.PatternLayout, log4net&quot;&gt;
&lt;param name=&quot;ConversionPattern&quot; value=&quot;%d [%t] %-5p %c - %m%n&quot; /&gt;
&lt;/layout&gt;
&lt;/appender&gt;
&lt;appender name=&quot;TraceAppender&quot; type=&quot;log4net.Appender.TraceAppender&quot;&gt;
&lt;layout type=&quot;log4net.Layout.PatternLayout&quot;&gt;
&lt;param name=&quot;ConversionPattern&quot; value=&quot;%-5p: %m&quot; /&gt;
&lt;/layout&gt;
&lt;/appender&gt;
&lt;root&gt;
&lt;level value=&quot;ALL&quot; /&gt;
&lt;appender-ref ref=&quot;TraceAppender&quot; /&gt;
&lt;appender-ref ref=&quot;RollingLogFileAppender&quot; /&gt;
&lt;/root&gt;
&lt;/log4net&gt;
&lt;/configuration&gt;
</code>
</example>
<author>Gilles Bayon</author>
<author>Erich Eichinger</author>
</member>
<member name="T:Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter.ILog4NetRuntime">
<summary>
Abstract interface to the underlying log4net runtime
</summary>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter.ILog4NetRuntime.XmlConfiguratorConfigure">
<summary>Calls <see cref="M:log4net.Config.XmlConfigurator.Configure"/></summary>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter.ILog4NetRuntime.XmlConfiguratorConfigure(System.String)">
<summary>Calls <see cref="M:log4net.Config.XmlConfigurator.Configure(System.IO.FileInfo)"/></summary>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter.ILog4NetRuntime.XmlConfiguratorConfigureAndWatch(System.String)">
<summary>Calls <see cref="M:log4net.Config.XmlConfigurator.ConfigureAndWatch(System.IO.FileInfo)"/></summary>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter.ILog4NetRuntime.BasicConfiguratorConfigure">
<summary>Calls <see cref="M:log4net.Config.BasicConfigurator.Configure"/></summary>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter.ILog4NetRuntime.GetLogger(System.String)">
<summary>Calls <see cref="M:Common.Logging.LogManager.GetLogger(System.String)"/></summary>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter.#ctor(Common.Logging.Configuration.NameValueCollection)">
<summary>
Constructor
</summary>
<param name="properties">configuration properties, see <see cref="T:Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter"/> for more.</param>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter.#ctor(System.Collections.Specialized.NameValueCollection)">
<summary>
Constructor for binary backwards compatibility with non-portableversions
</summary>
<param name="properties">The properties.</param>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter.#ctor(Common.Logging.Configuration.NameValueCollection,Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter.ILog4NetRuntime)">
<summary>
Constructor accepting configuration properties and an arbitrary
<see cref="T:Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter.ILog4NetRuntime"/> instance.
</summary>
<param name="properties">configuration properties, see <see cref="T:Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter"/> for more.</param>
<param name="runtime">a log4net runtime adapter</param>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter.CreateLogger(System.String)">
<summary>
Create a ILog instance by name
</summary>
<param name="name"></param>
<returns></returns>
</member>
<member name="T:Common.Logging.Log4Net.Log4NetNestedThreadVariablesContext">
<summary>
A global context for logger variables
</summary>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetNestedThreadVariablesContext.Push(System.String)">
<summary>Pushes a new context message into this stack.</summary>
<param name="text">The new context message text.</param>
<returns>
An <see cref="T:System.IDisposable" /> that can be used to clean up the context stack.
</returns>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetNestedThreadVariablesContext.Pop">
<summary>Removes the top context from this stack.</summary>
<returns>The message in the context that was removed from the top of this stack.</returns>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetNestedThreadVariablesContext.Clear">
<summary>
Remove all items from nested context
</summary>
</member>
<member name="P:Common.Logging.Log4Net.Log4NetNestedThreadVariablesContext.HasItems">
<summary>
Returns true if there is at least one item in the nested context; false, if empty
</summary>
</member>
<member name="T:Common.Logging.Log4Net.Log4NetThreadVariablesContext">
<summary>
A global context for logger variables
</summary>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetThreadVariablesContext.Set(System.String,System.Object)">
<summary>
Sets the value of a new or existing variable within the global context
</summary>
<param name="key">The key of the variable that is to be added</param>
<param name="value">The value to add</param>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetThreadVariablesContext.Get(System.String)">
<summary>
Gets the value of a variable within the global context
</summary>
<param name="key">The key of the variable to get</param>
<returns>The value or null if not found</returns>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetThreadVariablesContext.Contains(System.String)">
<summary>
Checks if a variable is set within the global context
</summary>
<param name="key">The key of the variable to check for</param>
<returns>True if the variable is set</returns>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetThreadVariablesContext.Remove(System.String)">
<summary>
Removes a variable from the global context by key
</summary>
<param name="key">The key of the variable to remove</param>
</member>
<member name="M:Common.Logging.Log4Net.Log4NetThreadVariablesContext.Clear">
<summary>
Clears the global context variables
</summary>
</member>
</members>
</doc>
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="utf-8" ?>
<log4net>
<appender name="errorAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="ERROR" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\err.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="infoAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\info.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="debugAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="DEBUG" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\debug.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="perfAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\perf.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %logger - %message%newline" />
</layout>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="errorAppender" />
<appender-ref ref="infoAppender" />
<appender-ref ref="debugAppender" />
</root>
<logger name="Performance" additivity="false">
<level value="ALL" />
<appender-ref ref="perfAppender" />
</logger>
</log4net>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
</configSections>
<connectionStrings>
<add name="ESDatabase" connectionString="host=mech.palaspom.com|tank.palaspom.com;port=19235;defaultIndex=palas" />
</connectionStrings>
<common>
<logging>
<factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4Net208">
<!--FILE
FILE-WATCH log4net节点在其他独立文件内部。
INLINE log4net节点在配置app.config内部。
EXTERNAL-->
<arg key="configType" value="FILE-WATCH" />
<arg key="configFile" value="~/Config/log4net.config" />
</factoryAdapter>
</logging>
</common>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<configuration> <configuration>
<startup>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
</configSections>
<connectionStrings>
<add name="ESDatabase" connectionString="host=mech.palaspom.com|tank.palaspom.com;port=19235;defaultIndex=palas" />
</connectionStrings>
<common>
<logging>
<factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4Net208">
<!--FILE
FILE-WATCH log4net节点在其他独立文件内部。
INLINE log4net节点在配置app.config内部。
EXTERNAL-->
<arg key="configType" value="FILE-WATCH" />
<arg key="configFile" value="~/Config/log4net.config" />
</factoryAdapter>
</logging>
</common>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup> </startup>
</configuration> </configuration>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
//要求通过newsid=itemid(ES中的)一一对应。
//要求通过newsid=itemid(ES中的)一一对应。
//要求取得以下字段,并返回统一包装的JSON结构。(AnalyzeData只有1个,里面的数据是common+reader(两者其中有值,值也是一样的,任取其一。可能存在相互补充的情况,合并为1个。))
[
{
"ItemID": "文章ID",
"ClickCount": "点击次数",
"Url": "文章Url",
"CleanTitle": "标题",
"CleanText": "正文",
"PubDate": "页面显示发布时间",
"MediaName": "21世纪经济报道",
"DuplicationID": "相似转载ID(早先入库的相似文章ID,第一篇该字段为空,其他均为第一篇的ID)",
"AnalyzeData语义分析结果字段": {
"MarketIDs": " 品类/市场common编号reader编号:有值任取其一",
"BlockIDs": "主题/板块编号common编号,reader编号:有值任取其一",
"StockIDs": "股票编号common编号,reader编号:有值任取其一",
"IG": ""
}
}
]
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -15,3 +15,32 @@ C:\Users\admin\Desktop\CsvCount_ES\CsvCount_ES\bin\Debug\CsvCount_ES.pdb ...@@ -15,3 +15,32 @@ C:\Users\admin\Desktop\CsvCount_ES\CsvCount_ES\bin\Debug\CsvCount_ES.pdb
C:\Users\admin\Desktop\CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.Form1.resources C:\Users\admin\Desktop\CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.Form1.resources
C:\Users\admin\Desktop\CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.Properties.Resources.resources C:\Users\admin\Desktop\CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.Properties.Resources.resources
C:\Users\admin\Desktop\CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.csproj.GenerateResource.Cache C:\Users\admin\Desktop\CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.csproj.GenerateResource.Cache
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\Config\log4net.config
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\OutPut\模板.json
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\CsvCount_ES.exe.config
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\CsvCount_ES.exe
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\CsvCount_ES.pdb
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\Common.Logging.Core.dll
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\Common.Logging.dll
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\Common.Logging.Log4Net208.dll
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\Elasticsearch.Net.dll
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\log4net.dll
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\MongoDB.Bson.dll
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\Nest.dll
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\Newtonsoft.Json.dll
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\Common.Logging.pdb
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\Common.Logging.xml
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\Common.Logging.Core.pdb
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\Common.Logging.Core.xml
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\Common.Logging.Log4Net208.pdb
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\Common.Logging.Log4Net208.xml
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\Elasticsearch.Net.xml
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\log4net.xml
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\MongoDB.Bson.xml
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\Nest.xml
D:\smallproject\6.CsvCount_ES\CsvCount_ES\bin\Debug\Newtonsoft.Json.xml
D:\smallproject\6.CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.Form1.resources
D:\smallproject\6.CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.Properties.Resources.resources
D:\smallproject\6.CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.csproj.GenerateResource.Cache
D:\smallproject\6.CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.exe
D:\smallproject\6.CsvCount_ES\CsvCount_ES\obj\Debug\CsvCount_ES.pdb
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Common.Logging" version="3.4.1" targetFramework="net45" />
<package id="Common.Logging.Core" version="3.4.1" targetFramework="net45" />
<package id="Common.Logging.Log4Net208" version="3.4.1" targetFramework="net45" />
<package id="Elasticsearch.Net" version="2.5.8" targetFramework="net45" />
<package id="log4net" version="2.0.8" targetFramework="net45" />
<package id="Microsoft.CSharp" version="4.0.1" targetFramework="net45" />
<package id="MongoDB.Bson" version="2.0.0" targetFramework="net45" />
<package id="NEST" version="2.5.8" targetFramework="net45" />
<package id="Newtonsoft.Json" version="11.0.1" targetFramework="net45" />
</packages>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment