AppSettings
20 | //{
21 | // get { return _appSettings; }
22 | //}
23 | }
24 | }
--------------------------------------------------------------------------------
/client/java/logging.client/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/client/csharp/Logging.Client.TestSite/Default.aspx.designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | // <自动生成>
3 | // 此代码由工具生成。
4 | //
5 | // 对此文件的更改可能会导致不正确的行为,并且如果
6 | // 重新生成代码,这些更改将会丢失。
7 | // 自动生成>
8 | //------------------------------------------------------------------------------
9 |
10 | namespace Logging.Client.TestSite {
11 |
12 |
13 | public partial class Default {
14 |
15 | ///
16 | /// form1 控件。
17 | ///
18 | ///
19 | /// 自动生成的字段。
20 | /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
21 | ///
22 | protected global::System.Web.UI.HtmlControls.HtmlForm form1;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/slf/Logger.java:
--------------------------------------------------------------------------------
1 | package org.apache.thrift.slf;
2 |
3 | public class Logger {
4 |
5 |
6 | public void debug (String title,Object obj){
7 |
8 | }
9 |
10 | public void debug (String message){
11 |
12 | }
13 |
14 | public void debug (String title,Object obj,int size){
15 |
16 | }
17 |
18 | public void info (String title,Object obj){
19 |
20 | }
21 |
22 | public void info (String message){
23 |
24 | }
25 |
26 | public void warn (String title,Object obj){
27 |
28 | }
29 |
30 | public void warn (String message){
31 |
32 | }
33 |
34 | public void error (String title,Object obj){
35 |
36 | }
37 |
38 | public void error (String message){
39 |
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/server/Logging.Server.Site/InfluxData.Net.dll.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/server/Logging.Server.Web/Controllers/AlertingController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Mvc;
2 |
3 | namespace Logging.Server.Web
4 | {
5 | public class AlertingController : Controller
6 | {
7 | public ActionResult Index()
8 | {
9 | return View();
10 | }
11 |
12 | public ActionResult About()
13 | {
14 | ViewData["Message"] = "Your application description page.";
15 |
16 | return View();
17 | }
18 |
19 | public ActionResult Contact()
20 | {
21 | ViewData["Message"] = "Your contact page.";
22 |
23 | return View();
24 | }
25 |
26 | public ActionResult Error()
27 | {
28 | return View();
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/server/Logging.Server.Web/Controllers/MetricsController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Mvc;
2 |
3 | namespace Logging.Server.Web
4 | {
5 | public class MetricsController : Controller
6 | {
7 | public ActionResult Index()
8 | {
9 | return View();
10 | }
11 |
12 | public ActionResult About()
13 | {
14 | ViewData["Message"] = "Your application description page.";
15 |
16 | return View();
17 | }
18 |
19 | public ActionResult Contact()
20 | {
21 | ViewData["Message"] = "Your contact page.";
22 |
23 | return View();
24 | }
25 |
26 | public ActionResult Error()
27 | {
28 | return View();
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/server/Logging.Server.Web/Controllers/SettingsController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Mvc;
2 |
3 | namespace Logging.Server.Web
4 | {
5 | public class SettingsController : Controller
6 | {
7 | public ActionResult Index()
8 | {
9 | return View();
10 | }
11 |
12 | public ActionResult About()
13 | {
14 | ViewData["Message"] = "Your application description page.";
15 |
16 | return View();
17 | }
18 |
19 | public ActionResult Contact()
20 | {
21 | ViewData["Message"] = "Your contact page.";
22 |
23 | return View();
24 | }
25 |
26 | public ActionResult Error()
27 | {
28 | return View();
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/client/java/logging.client/logging.client.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/server/Logging.Server.Site/metrics/test.aspx.designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | //
5 | // 对此文件的更改可能会导致不正确的行为,并且如果
6 | // 重新生成代码,这些更改将会丢失。
7 | //
8 | //------------------------------------------------------------------------------
9 |
10 | namespace Logging.Server.Site.metrics
11 | {
12 |
13 |
14 | public partial class test
15 | {
16 |
17 | ///
18 | /// form1 控件。
19 | ///
20 | ///
21 | /// 自动生成的字段。
22 | /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
23 | ///
24 | protected global::System.Web.UI.HtmlControls.HtmlForm form1;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/server/Logging.Server.Web/Controllers/LogViewerController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Mvc;
2 |
3 | namespace Logging.Server.Web
4 | {
5 | public class LogViewerController : Controller
6 | {
7 | public ActionResult Index()
8 | {
9 | return View();
10 | }
11 |
12 | public ActionResult About()
13 | {
14 | ViewData["Message"] = "Your application description page.";
15 |
16 | return View();
17 | }
18 |
19 | public ActionResult Contact()
20 | {
21 | ViewData["Message"] = "Your contact page.";
22 |
23 | return View();
24 | }
25 |
26 | public ActionResult Error()
27 | {
28 | return View();
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/server/Logging.Server.Web/Views/Shared/Error.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Error";
3 | }
4 |
5 | Error.
6 | An error occurred while processing your request.
7 |
8 | Development Mode
9 |
10 | Swapping to Development environment will display more detailed information about the error that occurred.
11 |
12 |
13 | Development environment should not be enabled in deployed applications , as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development , and restarting the application.
14 |
--------------------------------------------------------------------------------
/client/java/logging.client.test/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/server/Logging.Server.Site/MongoTools.aspx:
--------------------------------------------------------------------------------
1 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MongoTools.aspx.cs" Inherits="Logging.Server.Site.MongoTools" %>
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/client/java/logging.client.test/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/server/Logging.Server/LogWriter/HBaseWriter.cs:
--------------------------------------------------------------------------------
1 | using Logging.Server.Alerting;
2 | using System;
3 | using System.Collections.Generic;
4 |
5 | namespace Logging.Server.Writer
6 | {
7 | public class HBaseWriter : ILogWriter
8 | {
9 | public void RecordAlerting(AlertingHistory ah)
10 | {
11 | throw new NotImplementedException();
12 | }
13 |
14 | public void SetLogOnOff(LogOnOff on_off)
15 | {
16 | throw new NotImplementedException();
17 | }
18 |
19 | public void SetOptions(List opts)
20 | {
21 | throw new NotImplementedException();
22 | }
23 |
24 | public void Write(IList logs)
25 | {
26 | throw new NotImplementedException();
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/server/Logging.Server/Metric/MetricProcessor/DefaulMetricProcessor.cs:
--------------------------------------------------------------------------------
1 | using Logging.Server.Metric.Writer;
2 | using System.Collections.Generic;
3 |
4 | namespace Logging.Server.Metric.Processor
5 | {
6 | ///
7 | /// 处理队列元素(日志)的处理器
8 | ///
9 | public class DefaulMetricProcessor : IMetricProcessor
10 | {
11 | public void Process(IList logs)
12 | {
13 | if (Config.MetricInfluxdbVer == "0.8")
14 | {
15 | InfluxdbReport report = new InfluxdbReport();
16 | report.WriteAsync(logs);
17 | }
18 | else
19 | {
20 | InfluxdbWriter report = new InfluxdbWriter();
21 | report.WriteAsync(logs);
22 | }
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/server/Logging.Server/LogReciver/SocketReciver.cs:
--------------------------------------------------------------------------------
1 | using Logging.ThriftContract;
2 | using System;
3 | using Thrift.Server;
4 | using Thrift.Transport;
5 |
6 | namespace Logging.Server.Reciver
7 | {
8 | public class SocketReciver
9 | {
10 | public SocketReciver()
11 | {
12 | try
13 | {
14 | TServerSocket serverTransport = new TServerSocket(7911, 0, false);
15 | var processor = new LogTransferService.Processor(new LogReciverBase());
16 | TServer server = new TSimpleServer(processor, serverTransport);
17 | Console.WriteLine("Starting server on port 7911 ...");
18 | server.Serve();
19 | }
20 | catch (Exception e)
21 | {
22 | }
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/server/Logging.Server.Site/GetLogOnOffs.ashx.cs:
--------------------------------------------------------------------------------
1 | using Logging.Server.Viewer;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Web;
6 |
7 | namespace Logging.Server.Site
8 | {
9 | ///
10 | /// GetLogOnOffs 的摘要说明
11 | ///
12 | public class GetLogOnOffs : IHttpHandler
13 | {
14 |
15 | public void ProcessRequest(HttpContext context)
16 | {
17 | var on_offs = LogOnOffManager.GetALLLogOnOff();
18 | context.Response.ContentType = "text/plain";
19 | context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(on_offs));
20 | }
21 |
22 | public bool IsReusable
23 | {
24 | get
25 | {
26 | return false;
27 | }
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/client/dotnetcore/Logging.Client/System/SerializableAttribute.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | namespace System
4 | {
5 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Delegate, Inherited = false)]
6 | [System.Runtime.InteropServices.ComVisible(true)]
7 | public class SerializableAttribute : Attribute
8 | {
9 | internal static Attribute GetCustomAttribute(TypeInfo type)
10 | {
11 | return (type.Attributes & TypeAttributes.Serializable) == TypeAttributes.Serializable ? new SerializableAttribute() : null;
12 | }
13 |
14 | internal static bool IsDefined(TypeInfo type)
15 | {
16 | return type.IsSerializable;
17 | }
18 |
19 | public SerializableAttribute()
20 | {
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/server/Logging.Server.Site/alerting/GetAppErrOpts.ashx.cs:
--------------------------------------------------------------------------------
1 | using Logging.Server.Alerting;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Web;
6 |
7 | namespace Logging.Server.Site.alerting
8 | {
9 | ///
10 | /// GetAppErrOpts 的摘要说明
11 | ///
12 | public class GetAppErrOpts : IHttpHandler
13 | {
14 |
15 | public void ProcessRequest(HttpContext context)
16 | {
17 | context.Response.ContentType = "text/plain";
18 | var opts = AppErrorthAlerting.GetOptions();
19 | context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(opts));
20 | }
21 |
22 | public bool IsReusable
23 | {
24 | get
25 | {
26 | return false;
27 | }
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/server/Logging.Server.Site/Properties/PublishProfiles/release.server.logging.plu.cn.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | FileSystem
9 | Release
10 | Any CPU
11 |
12 | True
13 | False
14 | D:\Publish\release.server.logging.plu.cn
15 | True
16 |
17 |
--------------------------------------------------------------------------------
/client/csharp/Logging.Client.TestSite/Properties/PublishProfiles/release.client.logging.plu.cn.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | FileSystem
9 | Release
10 | Any CPU
11 |
12 | True
13 | False
14 | D:\Publish\release.client.logging.plu.cn
15 | True
16 |
17 |
--------------------------------------------------------------------------------
/client/dotnetcore/Logging.Client/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyConfiguration("")]
8 | [assembly: AssemblyCompany("")]
9 | [assembly: AssemblyProduct("Logging.Client")]
10 | [assembly: AssemblyTrademark("")]
11 |
12 | // Setting ComVisible to false makes the types in this assembly not visible
13 | // to COM components. If you need to access a type in this assembly from
14 | // COM, set the ComVisible attribute to true on that type.
15 | [assembly: ComVisible(false)]
16 |
17 | // The following GUID is for the ID of the typelib if this project is exposed to COM
18 | [assembly: Guid("c329ec03-d53b-482b-a922-cc53052788f0")]
--------------------------------------------------------------------------------
/server/Logging.Server/LogViewer/LogViewerManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Configuration;
3 |
4 | namespace Logging.Server.Viewer
5 | {
6 | public sealed class LogViewerManager
7 | {
8 | private LogViewerManager()
9 | { }
10 |
11 | public static ILogViewer GetLogViewer()
12 | {
13 | string LoggingStorage = ConfigurationManager.AppSettings["LoggingStorage"];
14 |
15 | if (LoggingStorage.Equals("mongodb", StringComparison.OrdinalIgnoreCase))
16 | {
17 | return new MongoDbViewer();
18 | }
19 | else if (LoggingStorage.Equals("hbase", StringComparison.OrdinalIgnoreCase))
20 | {
21 | return new HBaseViewer();
22 | }
23 | else
24 | {
25 | return new MongoDbViewer();
26 | }
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/server/Logging.Server/LogWriter/LogWriterManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Configuration;
3 |
4 | namespace Logging.Server.Writer
5 | {
6 | public sealed class LogWriterManager
7 | {
8 | private static string LoggingStorage = ConfigurationManager.AppSettings["LoggingStorage"];
9 |
10 | private LogWriterManager()
11 | { }
12 |
13 | public static ILogWriter GetLogWriter()
14 | {
15 | if (LoggingStorage.Equals("mongodb", StringComparison.OrdinalIgnoreCase))
16 | {
17 | return new MongoDbWriter();
18 | }
19 | else if (LoggingStorage.Equals("hbase", StringComparison.OrdinalIgnoreCase))
20 | {
21 | return new HBaseWriter();
22 | }
23 | else
24 | {
25 | return new MongoDbWriter();
26 | }
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/server/Logging.Server/Metric/Json/JsonObject.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | namespace Logging.Server.Metric.Json
6 | {
7 | public class JsonObject
8 | {
9 | public JsonObject(IEnumerable properties)
10 | {
11 | this.Properties = properties;
12 | }
13 |
14 | public IEnumerable Properties { get; private set; }
15 |
16 | public string AsJson(bool indented = true, int indent = 0)
17 | {
18 | indent = indented ? indent : 0;
19 | var properties = this.Properties.Select(p => p.AsJson(indented, indent + 2));
20 |
21 | var jsonProperties = string.Join(indented ? "," + Environment.NewLine : ",", properties);
22 |
23 | return string.Format(indented ? "{{\r\n{0}\r\n{1}}}" : "{{{0}}}{1}", jsonProperties, new string(' ', indent));
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/server/Logging.Server/LogViewer/ILogView.cs:
--------------------------------------------------------------------------------
1 | using Logging.Server.Alerting;
2 | using System.Collections.Generic;
3 |
4 | namespace Logging.Server.Viewer
5 | {
6 | public interface ILogViewer
7 | {
8 | List GetLogs(long start, long end, int appId, int[] level, string title, string msg, string source, long ip, List tags, int limit = 100);
9 |
10 | List GetStatistics(long start, long end, int appId);
11 |
12 | ///
13 | /// 获取所有日志开关
14 | ///
15 | ///
16 | List GetALLLogOnOff();
17 |
18 | ///
19 | /// 获取指定AppId的日志开关
20 | ///
21 | ///
22 | LogOnOff GetLogOnOff(int appId);
23 |
24 | AlertingHistory GetLastAlertingHistory(int appId, AlertingType appError);
25 |
26 | List GetOptions(string[] optKeys);
27 | }
28 | }
--------------------------------------------------------------------------------
/server/Logging.Server/Metric/Config.cs:
--------------------------------------------------------------------------------
1 | namespace Logging.Server.Metric
2 | {
3 | //public class Config
4 | //{
5 | // public static readonly string MetricInfluxdbHost = System.Configuration.ConfigurationManager.AppSettings["MetricInfluxdbHost"];
6 | // public static readonly string MetricInfluxdbPort = System.Configuration.ConfigurationManager.AppSettings["MetricInfluxdbPort"];
7 | // public static readonly string MetricInfluxdbDBName = System.Configuration.ConfigurationManager.AppSettings["MetricInfluxdbDBName"];
8 | // public static readonly string MetricInfluxdbUser = System.Configuration.ConfigurationManager.AppSettings["MetricInfluxdbUser"];
9 | // public static readonly string MetricInfluxdbPwd = System.Configuration.ConfigurationManager.AppSettings["MetricInfluxdbPwd"];
10 | // public static readonly string MetricInfluxdbVer = System.Configuration.ConfigurationManager.AppSettings["MetricInfluxdbVer"];
11 |
12 | //}
13 | }
--------------------------------------------------------------------------------
/client/java/logging.client.test/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | logging.client4j.test
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.wst.common.project.facet.core.builder
15 |
16 |
17 |
18 |
19 | org.eclipse.wst.validation.validationbuilder
20 |
21 |
22 |
23 |
24 |
25 | org.eclipse.jem.workbench.JavaEMFNature
26 | org.eclipse.wst.common.modulecore.ModuleCoreNature
27 | org.eclipse.wst.common.project.facet.core.nature
28 | org.eclipse.jdt.core.javanature
29 |
30 |
31 |
--------------------------------------------------------------------------------
/client/go/loggingclient/thrift/exception.go:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package thrift
21 |
22 | // Generic Thrift exception
23 | type TException interface {
24 | error
25 | }
26 |
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/TEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.thrift;
21 |
22 | public interface TEnum {
23 | public int getValue();
24 | }
25 |
--------------------------------------------------------------------------------
/server/Logging.Server.Site/Test/MetricTest.aspx.designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | // <自动生成>
3 | // 此代码由工具生成。
4 | //
5 | // 对此文件的更改可能导致不正确的行为,如果
6 | // 重新生成代码,则所做更改将丢失。
7 | // 自动生成>
8 | //------------------------------------------------------------------------------
9 |
10 | namespace Logging.Server.Site.Test {
11 |
12 |
13 | public partial class MetricTest {
14 |
15 | ///
16 | /// form1 控件。
17 | ///
18 | ///
19 | /// 自动生成的字段。
20 | /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
21 | ///
22 | protected global::System.Web.UI.HtmlControls.HtmlForm form1;
23 |
24 | ///
25 | /// Button1 控件。
26 | ///
27 | ///
28 | /// 自动生成的字段。
29 | /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
30 | ///
31 | protected global::System.Web.UI.WebControls.Button Button1;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/server/Logging.Server.Web/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // 有关程序集的常规信息是通过以下项进行控制的
5 | // 控制。更改这些特性值可修改
6 | // 与程序集关联的信息。
7 | [assembly: AssemblyTitle("Logging.Server.Web")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("Microsoft")]
11 | [assembly: AssemblyProduct("Logging.Server.Web")]
12 | [assembly: AssemblyCopyright("版权所有(C) Microsoft 2017")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // 将 ComVisible 设置为 false 将使此程序集中的类型
17 | // 对 COM 组件不可见。如果需要
18 | // 从 COM 访问此程序集中的某个类型,请针对该类型将 ComVisible 特性设置为 true。
19 | [assembly: ComVisible(false)]
20 |
21 | // 如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID
22 | [assembly: Guid("31a6c8ca-0aea-414c-9ac4-be3024ba7e8f")]
23 |
24 | // 程序集的版本信息由下列四个值组成:
25 | //
26 | // 主版本
27 | // 次版本
28 | // 内部版本号
29 | // 修订版本
30 | //
31 | // 你可以指定所有值,也可以让修订版本和内部版本号采用默认值,
32 | // 方法是按如下所示使用 "*":
33 | [assembly: AssemblyVersion("1.0.0.0")]
34 | [assembly: AssemblyFileVersion("1.0.0.0")]
--------------------------------------------------------------------------------
/client/dotnetcore/Logging.Client/Logging.Client.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Logging.Client", "Logging.Client.xproj", "{C329EC03-D53B-482B-A922-CC53052788F0}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {C329EC03-D53B-482B-A922-CC53052788F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {C329EC03-D53B-482B-A922-CC53052788F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {C329EC03-D53B-482B-A922-CC53052788F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {C329EC03-D53B-482B-A922-CC53052788F0}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/client/go/loggingclient/thrift/protocol_factory.go:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package thrift
21 |
22 | // Factory interface for constructing protocol instances.
23 | type TProtocolFactory interface {
24 | GetProtocol(trans TTransport) TProtocol
25 | }
26 |
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/scheme/SchemeFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.thrift.scheme;
20 |
21 | public interface SchemeFactory {
22 |
23 | public S getScheme();
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/server/Logging.Server.Site/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Web;
3 | using System.Web.Http;
4 | using System.Web.Mvc;
5 | using System.Web.Optimization;
6 | using System.Web.Routing;
7 |
8 | namespace Logging.Server.Site
9 | {
10 | public class Global : HttpApplication
11 | {
12 | private void Application_Start(object sender, EventArgs e)
13 | {
14 | AreaRegistration.RegisterAllAreas();
15 | GlobalConfiguration.Configure(WebApiConfig.Register);
16 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
17 | RouteConfig.RegisterRoutes(RouteTable.Routes);
18 | //BundleConfig.RegisterBundles(BundleTable.Bundles);
19 |
20 | // 在应用程序启动时运行的代码
21 | BackgroundTask.InitTasks();
22 | }
23 |
24 | private void Application_End(object sender, EventArgs e)
25 | {
26 | // 在应用程序关闭时运行的代码
27 | }
28 |
29 | private void Application_Error(object sender, EventArgs e)
30 | {
31 | // 在出现未处理的错误时运行的代码
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/server/Logging.Server/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // 有关程序集的常规信息通过以下
5 | // 特性集控制。更改这些特性值可修改
6 | // 与程序集关联的信息。
7 | [assembly: AssemblyTitle("Logging.Server")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("Logging.Server")]
12 | [assembly: AssemblyCopyright("Copyright © 2015")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // 将 ComVisible 设置为 false 使此程序集中的类型
17 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
18 | // 则将该类型上的 ComVisible 特性设置为 true。
19 | [assembly: ComVisible(false)]
20 |
21 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
22 | [assembly: Guid("3b298724-5531-4849-9a06-ad3fb21edc9f")]
23 |
24 | // 程序集的版本信息由下面四个值组成:
25 | //
26 | // 主版本
27 | // 次版本
28 | // 生成号
29 | // 修订号
30 | //
31 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
32 | // 方法是按如下所示使用“*”:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
--------------------------------------------------------------------------------
/client/csharp/Logging.Client/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // 有关程序集的常规信息通过以下
5 | // 特性集控制。更改这些特性值可修改
6 | // 与程序集关联的信息。
7 | [assembly: AssemblyTitle("Logging.Client")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("Logging.Client")]
12 | [assembly: AssemblyCopyright("Copyright © 2015")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // 将 ComVisible 设置为 false 使此程序集中的类型
17 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
18 | // 则将该类型上的 ComVisible 特性设置为 true。
19 | [assembly: ComVisible(false)]
20 |
21 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
22 | [assembly: Guid("8ae7cded-27b9-4745-bd25-d01f296497af")]
23 |
24 | // 程序集的版本信息由下面四个值组成:
25 | //
26 | // 主版本
27 | // 次版本
28 | // 生成号
29 | // 修订号
30 | //
31 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
32 | // 方法是按如下所示使用“*”:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.1.0.6")]
35 | [assembly: AssemblyFileVersion("1.1.0.6")]
--------------------------------------------------------------------------------
/contract/Thrift/Thrift/Protocol/TMessageType.cs:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | namespace Thrift.Protocol
21 | {
22 | public enum TMessageType
23 | {
24 | Call = 1,
25 | Reply = 2,
26 | Exception = 3,
27 | Oneway = 4
28 | }
29 | }
--------------------------------------------------------------------------------
/client/go/loggingclient/LogManager.go:
--------------------------------------------------------------------------------
1 | package loggingclient
2 |
3 | import (
4 | "fmt"
5 | "time"
6 | )
7 |
8 | // var _instance *object
9 |
10 | // type object struct {
11 | // name string
12 | // }
13 |
14 | // func Instance() *object {
15 | // if _instance == nil {
16 | // _instance = new(object)
17 | // }
18 | // return _instance
19 | // }
20 |
21 | // func (p *object) Setname(name string) {
22 | // p.name = name
23 | // }
24 |
25 | // func (p *object) Say() {
26 | // fmt.Println(p.name)
27 | // }
28 |
29 | // type LogManager struct {
30 | // Logs map[string]ILog
31 | // }
32 | var logs map[string]ILog
33 |
34 | func init() {
35 | logs = make(map[string]ILog)
36 | }
37 |
38 | // GetLogger 获取ILog对象
39 | func GetLogger(source string) (ret ILog) {
40 |
41 | if log, ok := logs[source]; ok {
42 | return log
43 | }
44 | newLog := NewBaseLogger(source)
45 | fmt.Println(time.Now().String() + ":创建ILog " + source)
46 | logs[source] = newLog
47 | return newLog
48 | }
49 |
50 | func loggingEnabled() bool {
51 | return LoggingSettings != nil && LoggingSettings.LoggingEnabled
52 | }
53 |
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/server/ServerContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * Interface for storing server's connection context
22 | */
23 |
24 | package org.apache.thrift.server;
25 |
26 | public interface ServerContext {}
27 |
--------------------------------------------------------------------------------
/server/Logging.Server.Site/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过下列特性集
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Logging.Server.Site")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Logging.Server.Site")]
13 | [assembly: AssemblyCopyright("版权所有(C) 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的某个类型,
19 | // 请针对该类型将 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("606e860c-322a-4ede-870e-a59df0afe088")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“修订号”和“内部版本号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/client/go/loggingclient/Utils.go:
--------------------------------------------------------------------------------
1 | package loggingclient
2 |
3 | import (
4 | "net"
5 | "strconv"
6 | "strings"
7 | )
8 |
9 | func getInternalIP() string {
10 |
11 | addrs, err := net.InterfaceAddrs()
12 | if err != nil {
13 | return ""
14 | }
15 | var ipAddr string
16 | for _, a := range addrs {
17 | if ipnet, ok := a.(*net.IPNet); ok && !ipnet.IP.IsLoopback() {
18 | if ipnet.IP.To4() != nil {
19 |
20 | ipAddr = ipnet.IP.String()
21 | }
22 | }
23 | }
24 | return ipAddr
25 | }
26 |
27 | func ipToNum(ipAddr string) int64 {
28 |
29 | if ipAddr == "" {
30 | return 0
31 | }
32 | bits := strings.Split(ipAddr, ".")
33 | len := len(bits)
34 | b0, b1, b2, b3 := 0, 0, 0, 0
35 | if len >= 1 {
36 | b0, _ = strconv.Atoi(bits[0])
37 | }
38 | if len >= 2 {
39 | b1, _ = strconv.Atoi(bits[1])
40 | }
41 | if len >= 3 {
42 | b2, _ = strconv.Atoi(bits[2])
43 | }
44 | if len >= 4 {
45 | b3, _ = strconv.Atoi(bits[3])
46 | }
47 |
48 | var sum int64
49 |
50 | sum += int64(b0) << 24
51 | sum += int64(b1) << 16
52 | sum += int64(b2) << 8
53 | sum += int64(b3)
54 |
55 | return sum
56 | }
57 |
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/scheme/TupleScheme.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.thrift.scheme;
20 |
21 | import org.apache.thrift.TBase;
22 |
23 | public abstract class TupleScheme implements IScheme {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/contract/Thrift/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的一般信息由以下
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Thrift")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Thrift")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | //将 ComVisible 设置为 false 将使此程序集中的类型
18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
19 | //请将此类型的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("04581f78-bc60-49c0-b279-72e525174f0c")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”: :
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/client/dotnetcore/Logging.Client/Thrift/Protocol/TMessageType.cs:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | namespace Thrift.Protocol
21 | {
22 | public enum TMessageType
23 | {
24 | Call = 1,
25 | Reply = 2,
26 | Exception = 3,
27 | Oneway = 4
28 | }
29 | }
--------------------------------------------------------------------------------
/client/java/logging.client/.gitignore:
--------------------------------------------------------------------------------
1 | *.class
2 |
3 | # Mobile Tools for Java (J2ME)
4 | .mtj.tmp/
5 |
6 | # Package Files #
7 | *.jar
8 | *.war
9 | *.ear
10 |
11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
12 | hs_err_pid*
13 |
14 | # =========================
15 | # Operating System Files
16 | # =========================
17 |
18 | # OSX
19 | # =========================
20 |
21 | .DS_Store
22 | .AppleDouble
23 | .LSOverride
24 |
25 | # Thumbnails
26 | ._*
27 |
28 | # Files that might appear on external disk
29 | .Spotlight-V100
30 | .Trashes
31 |
32 | # Directories potentially created on remote AFP share
33 | .AppleDB
34 | .AppleDesktop
35 | Network Trash Folder
36 | Temporary Items
37 | .apdisk
38 |
39 | # Windows
40 | # =========================
41 |
42 | # Windows image file caches
43 | Thumbs.db
44 | ehthumbs.db
45 |
46 | # Folder config file
47 | Desktop.ini
48 |
49 | # Recycle Bin used on file shares
50 | $RECYCLE.BIN/
51 |
52 | # Windows Installer files
53 | *.cab
54 | *.msi
55 | *.msm
56 | *.msp
57 |
58 | # Windows shortcuts
59 | *.lnk
60 | /target/
61 | /classes
62 |
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/scheme/StandardScheme.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.thrift.scheme;
20 |
21 | import org.apache.thrift.TBase;
22 |
23 | public abstract class StandardScheme implements IScheme {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/client/csharp/Logging.Client.TestSite/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过下列特性集
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Logging.Client.TestSite")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Logging.Client.TestSite")]
13 | [assembly: AssemblyCopyright("版权所有(C) 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的某个类型,
19 | // 请针对该类型将 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("a5c7f5a5-adbd-42a9-a6a4-929d663a1f43")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“修订号”和“内部版本号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/client/csharp/Logging.Client/WebClientEx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Net;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Logging.Client
9 | {
10 | public class WebClientEx : WebClient
11 | {
12 | private int _timeout;
13 | ///
14 | /// 超时时间(毫秒)
15 | ///
16 | public int Timeout
17 | {
18 | get
19 | {
20 | return _timeout;
21 | }
22 | set
23 | {
24 | _timeout = value;
25 | }
26 | }
27 |
28 | public WebClientEx()
29 | {
30 | this._timeout = 60000;
31 | }
32 |
33 | public WebClientEx(int timeout)
34 | {
35 | this._timeout = timeout;
36 | }
37 |
38 | protected override WebRequest GetWebRequest(Uri address)
39 | {
40 | var result = base.GetWebRequest(address);
41 | result.Timeout = this._timeout;
42 | return result;
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/server/Logging.Server.Web/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
--------------------------------------------------------------------------------
/server/Logging.Server.Site/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/contract/Thrift/Thrift/Protocol/TAbstractBase.cs:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | namespace Thrift.Protocol
21 | {
22 | public interface TAbstractBase
23 | {
24 | ///
25 | /// Writes the objects out to the protocol
26 | ///
27 | void Write(TProtocol tProtocol);
28 | }
29 | }
--------------------------------------------------------------------------------
/contract/Thrift/Thrift/Protocol/TBase.cs:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | namespace Thrift.Protocol
21 | {
22 | public interface TBase : TAbstractBase
23 | {
24 | ///
25 | /// Reads the TObject from the given input protocol.
26 | ///
27 | void Read(TProtocol tProtocol);
28 | }
29 | }
--------------------------------------------------------------------------------
/contract/Logging.ThriftContract/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的一般信息由以下
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Logging.ThriftContract")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Logging.ThriftContract")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | //将 ComVisible 设置为 false 将使此程序集中的类型
18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
19 | //请将此类型的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("9cf113f2-c0a6-4267-8878-1fadeab1a5ba")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”: :
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/client/dotnetcore/Logging.Client/Thrift/Protocol/TAbstractBase.cs:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | namespace Thrift.Protocol
21 | {
22 | public interface TAbstractBase
23 | {
24 | ///
25 | /// Writes the objects out to the protocol
26 | ///
27 | void Write(TProtocol tProtocol);
28 | }
29 | }
--------------------------------------------------------------------------------
/client/java/logging.client/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | aaaa
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.wst.common.project.facet.core.builder
10 |
11 |
12 |
13 |
14 | org.eclipse.jdt.core.javabuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.wst.validation.validationbuilder
20 |
21 |
22 |
23 |
24 | org.eclipse.m2e.core.maven2Builder
25 |
26 |
27 |
28 |
29 |
30 | org.eclipse.jem.workbench.JavaEMFNature
31 | org.eclipse.wst.common.modulecore.ModuleCoreNature
32 | org.eclipse.jdt.core.javanature
33 | org.eclipse.m2e.core.maven2Nature
34 | org.eclipse.wst.common.project.facet.core.nature
35 |
36 |
37 |
--------------------------------------------------------------------------------
/server/Logging.Server/BackgroundTask.cs:
--------------------------------------------------------------------------------
1 | using Logging.Server.Alerting;
2 | using System;
3 | using System.Threading;
4 |
5 | namespace Logging.Server
6 | {
7 | public class BackgroundTask
8 | {
9 | public static void InitTasks()
10 | {
11 | var t = new Thread(CheckAlerting);
12 | t.IsBackground = false;
13 | t.Start();
14 | }
15 |
16 | private static void CheckAlerting()
17 | {
18 | while (true)
19 | {
20 | try
21 | {
22 | BaseAlerting alert = new AppErrorthAlerting();
23 | alert.Alert();
24 | }
25 | catch (ThreadAbortException tae)
26 | {
27 | Thread.ResetAbort();
28 | FileLogger.Log(tae);
29 | }
30 | catch (Exception ex)
31 | {
32 | FileLogger.Log(ex);
33 | }
34 | finally
35 | {
36 | Thread.Sleep(1000 * 60);
37 | }
38 | }
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/client/csharp/Logging.Client.TestSite/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
30 |
31 |
--------------------------------------------------------------------------------
/client/dotnetcore/Logging.Client/Thrift/Protocol/TBase.cs:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | namespace Thrift.Protocol
21 | {
22 | public interface TBase : TAbstractBase
23 | {
24 | ///
25 | /// Reads the TObject from the given input protocol.
26 | ///
27 | void Read(TProtocol tProtocol);
28 | }
29 | }
--------------------------------------------------------------------------------
/client/csharp/Logging.Client.TestSite/Properties/PublishProfiles/release.client.logging.plu.cn.pubxml.user:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 | <_PublishTargetUrl>D:\Publish\release.client.logging.plu.cn
10 |
11 |
12 |
13 | 09/07/2016 15:24:03
14 |
15 |
16 | 09/07/2016 15:24:03
17 |
18 |
19 | 09/17/2015 18:02:20
20 |
21 |
22 | 09/17/2015 18:02:20
23 |
24 |
25 | 09/07/2016 15:24:04
26 |
27 |
28 |
--------------------------------------------------------------------------------
/client/java/logging.client/settings.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | CN
14 | OSChina Central
15 | http://maven.oschina.net/content/groups/public/
16 | central
17 |
18 |
19 | ibiblio.org
20 | ibiblio Mirror of http://repo1.maven.org/maven2/
21 | http://mirrors.ibiblio.org/pub/mirrors/maven2
22 | central
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/async/TAsyncClientFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.thrift.async;
20 |
21 | import org.apache.thrift.transport.TNonblockingTransport;
22 |
23 | public interface TAsyncClientFactory {
24 | public T getAsyncClient(TNonblockingTransport transport);
25 | }
26 |
--------------------------------------------------------------------------------
/server/Logging.Server.Site/alerting/SetAppErrOpts.ashx.cs:
--------------------------------------------------------------------------------
1 | using Logging.Server.Alerting;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Web;
6 |
7 | namespace Logging.Server.Site.alerting
8 | {
9 | ///
10 | /// SetAppErrOpts 的摘要说明
11 | ///
12 | public class SetAppErrOpts : IHttpHandler
13 | {
14 |
15 | public void ProcessRequest(HttpContext context)
16 | {
17 | context.Response.ContentType = "text/plain";
18 | var interval = Convert.ToInt32(context.Request["interval"]);
19 | var errorCountLimit = Convert.ToInt32(context.Request["errorCountLimit"]);
20 | var errorGrowthLimit = Convert.ToInt32(context.Request["errorGrowthLimit"]);
21 | var emailReceivers = context.Request["emailReceivers"];
22 | AppErrorthAlerting.SetOptions(interval, errorCountLimit, errorGrowthLimit, emailReceivers);
23 | context.Response.Write("{'status':1}");
24 | }
25 |
26 | public bool IsReusable
27 | {
28 | get
29 | {
30 | return false;
31 | }
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/logging/client/THttpLogSender.java:
--------------------------------------------------------------------------------
1 | package logging.client;
2 |
3 | import java.util.List;
4 |
5 | import org.apache.thrift.protocol.TCompactProtocol;
6 | import org.apache.thrift.transport.THttpClient;
7 | import org.apache.thrift.transport.TTransport;
8 |
9 | public class THttpLogSender extends LogSenderBase {
10 |
11 | @Override
12 | public void Send(List logEntities) {
13 |
14 |
15 | try {
16 | if (logEntities == null || logEntities.size() <= 0) {
17 | return;
18 | }
19 | TLogPackage logPackage = CreateLogPackage(logEntities);
20 |
21 | TTransport httpClient = new THttpClient(Settings.LoggingServerHost + "/Reciver.ashx");
22 |
23 | TCompactProtocol protocol = new TCompactProtocol(httpClient);
24 | httpClient.open();
25 | LogTransferService.Client client = new LogTransferService.Client(protocol);
26 | client.Log(logPackage);
27 | httpClient.close();
28 | } catch (Exception e) {
29 | // TODO Auto-generated catch block
30 | e.printStackTrace();
31 | }
32 | }
33 |
34 |
35 | }
--------------------------------------------------------------------------------
/server/Logging.Server.Web/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
--------------------------------------------------------------------------------
/server/Logging.Server.Site/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/client/csharp/Logging.Client.TestSite/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
31 |
32 |
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/TFieldRequirementType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.thrift;
21 |
22 | /**
23 | * Requirement type constants.
24 | *
25 | */
26 | public final class TFieldRequirementType {
27 | public static final byte REQUIRED = 1;
28 | public static final byte OPTIONAL = 2;
29 | public static final byte DEFAULT = 3;
30 | }
31 |
--------------------------------------------------------------------------------
/client/csharp/Logging.Client/LogEntity.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Logging.Client
4 | {
5 |
6 |
7 | interface ILogEntity
8 | {
9 | ///
10 | /// 类型:1Log;2:Metric
11 | ///
12 | int Type { get; set; }
13 | }
14 |
15 | public class LogEntity: ILogEntity
16 | {
17 | public int Type { get; set; }
18 |
19 | public LogEntity() { this.Type = 1; }
20 |
21 | public string Title { get; set; }
22 |
23 | public string Message { get; set; }
24 |
25 | public LogLevel Level { get; set; }
26 |
27 | public long Time { get; set; }
28 |
29 | public string Source { get; set; }
30 |
31 | public int Thread { get; set; }
32 |
33 | public Dictionary Tags { get; set; }
34 | }
35 |
36 | public class MetricEntity : ILogEntity
37 | {
38 | public MetricEntity() { this.Type = 2; }
39 |
40 | public int Type { get; set; }
41 |
42 | public string Name { get; set; }
43 |
44 | public double Value { get; set; }
45 |
46 | public long Time { get; set; }
47 |
48 | public Dictionary Tags { get; set; }
49 | }
50 |
51 | }
--------------------------------------------------------------------------------
/client/java/logging.client/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 |
5 | logging.client
6 | logging.client
7 | 1.1
8 | jar
9 |
10 | logging.client
11 | http://maven.apache.org
12 |
13 |
14 |
15 | org.apache.maven.plugins
16 | maven-compiler-plugin
17 |
18 | 1.8
19 | 1.8
20 |
21 |
22 |
23 |
24 |
25 |
26 | UTF-8
27 |
28 |
29 |
30 |
31 | org.apache.httpcomponents
32 | httpclient
33 | 4.5.1
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/logging/client/LogManager.java:
--------------------------------------------------------------------------------
1 | package logging.client;
2 |
3 | import java.util.Hashtable;
4 |
5 | public class LogManager {
6 |
7 | static Hashtable _logs = new Hashtable();
8 |
9 |
10 | private LogManager()
11 | { }
12 |
13 | ///
14 | /// 通过类型名获取ILog实例。
15 | ///
16 | /// The type.
17 | /// ILog instance
18 | public static ILog getLogger(Class type)
19 | {
20 | if (type == null)
21 | {
22 | return getLogger("NoName");
23 | }
24 | else
25 | {
26 | return getLogger(type.getName());
27 | }
28 | }
29 |
30 | ///
31 | /// 通过字符串名获取ILog实例。
32 | ///
33 | /// The name.
34 | /// ILog instance
35 | public static ILog getLogger(String name)
36 | {
37 | ILog log = _logs.get(name);
38 | if (log==null)
39 | {
40 | log = new SimpleLogger(name);
41 | _logs.put(name, log);
42 | }
43 | return log;
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/client/dotnetcore/Logging.Client/Logging.Client.xproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 14.0
5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
6 |
7 |
8 |
9 |
10 | c329ec03-d53b-482b-a922-cc53052788f0
11 | Logging.Client
12 | .\obj
13 | .\bin\
14 | v4.5
15 |
16 |
17 |
18 | 2.0
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/contract/Thrift/Thrift/TProcessor.cs:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | *
19 | * Contains some contributions under the Thrift Software License.
20 | * Please see doc/old-thrift-license.txt in the Thrift distribution for
21 | * details.
22 | */
23 |
24 | using Thrift.Protocol;
25 |
26 | namespace Thrift
27 | {
28 | public interface TProcessor
29 | {
30 | bool Process(TProtocol iprot, TProtocol oprot);
31 | }
32 | }
--------------------------------------------------------------------------------
/server/Logging.Server/LogViewer/HBaseViewer.cs:
--------------------------------------------------------------------------------
1 | using Logging.Server.Alerting;
2 | using System;
3 | using System.Collections.Generic;
4 |
5 | namespace Logging.Server.Viewer
6 | {
7 | internal class HBaseViewer : ILogViewer
8 | {
9 | public List GetALLLogOnOff()
10 | {
11 | throw new NotImplementedException();
12 | }
13 |
14 | public AlertingHistory GetLastAlertingHistory(int appId, AlertingType appError)
15 | {
16 | throw new NotImplementedException();
17 | }
18 |
19 | public LogOnOff GetLogOnOff(int appId)
20 | {
21 | throw new NotImplementedException();
22 | }
23 |
24 | public List GetLogs(long start, long end, int appId, int[] level, string title, string msg, string source, long ip, List tags, int limit = 100)
25 | {
26 | return null;
27 | }
28 |
29 | public List GetOptions(string[] optKeys)
30 | {
31 | throw new NotImplementedException();
32 | }
33 |
34 | public List GetStatistics(long start, long end, int appId)
35 | {
36 | throw new NotImplementedException();
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/client/go/loggingclient/thrift/processor.go:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package thrift
21 |
22 | // A processor is a generic object which operates upon an input stream and
23 | // writes to some output stream.
24 | type TProcessor interface {
25 | Process(in, out TProtocol) (bool, TException)
26 | }
27 |
28 | type TProcessorFunction interface {
29 | Process(seqId int32, in, out TProtocol) (bool, TException)
30 | }
31 |
--------------------------------------------------------------------------------
/client/go/loggingclient/thrift/messagetype.go:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package thrift
21 |
22 | // Message type constants in the Thrift protocol.
23 | type TMessageType int32
24 |
25 | const (
26 | INVALID_TMESSAGE_TYPE TMessageType = 0
27 | CALL TMessageType = 1
28 | REPLY TMessageType = 2
29 | EXCEPTION TMessageType = 3
30 | ONEWAY TMessageType = 4
31 | )
32 |
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/meta_data/ListMetaData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.thrift.meta_data;
21 |
22 | public class ListMetaData extends FieldValueMetaData {
23 | public final FieldValueMetaData elemMetaData;
24 |
25 | public ListMetaData(byte type, FieldValueMetaData eMetaData){
26 | super(type);
27 | this.elemMetaData = eMetaData;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/meta_data/SetMetaData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.thrift.meta_data;
21 |
22 | public class SetMetaData extends FieldValueMetaData {
23 | public final FieldValueMetaData elemMetaData;
24 |
25 | public SetMetaData(byte type, FieldValueMetaData eMetaData){
26 | super(type);
27 | this.elemMetaData = eMetaData;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/client/csharp/Logging.Client.TestSite/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/client/dotnetcore/Logging.Client/Thrift/TProcessor.cs:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | *
19 | * Contains some contributions under the Thrift Software License.
20 | * Please see doc/old-thrift-license.txt in the Thrift distribution for
21 | * details.
22 | */
23 |
24 | using Thrift.Protocol;
25 |
26 | namespace Thrift
27 | {
28 | public interface TProcessor
29 | {
30 | bool Process(TProtocol iprot, TProtocol oprot);
31 | }
32 | }
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/protocol/TStruct.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.thrift.protocol;
21 |
22 | /**
23 | * Helper class that encapsulates struct metadata.
24 | *
25 | */
26 | public final class TStruct {
27 | public TStruct() {
28 | this("");
29 | }
30 |
31 | public TStruct(String n) {
32 | name = n;
33 | }
34 |
35 | public final String name;
36 | }
37 |
--------------------------------------------------------------------------------
/contract/Thrift/Thrift/Protocol/TProtocolFactory.cs:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | *
19 | * Contains some contributions under the Thrift Software License.
20 | * Please see doc/old-thrift-license.txt in the Thrift distribution for
21 | * details.
22 | */
23 |
24 | using Thrift.Transport;
25 |
26 | namespace Thrift.Protocol
27 | {
28 | public interface TProtocolFactory
29 | {
30 | TProtocol GetProtocol(TTransport trans);
31 | }
32 | }
--------------------------------------------------------------------------------
/server/Logging.Server.Site/App_Start/BundleConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Web;
2 | using System.Web.Optimization;
3 |
4 | namespace Logging.Server.Site
5 | {
6 | public class BundleConfig
7 | {
8 | // 有关绑定的详细信息,请访问 http://go.microsoft.com/fwlink/?LinkId=301862
9 | public static void RegisterBundles(BundleCollection bundles)
10 | {
11 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
12 | "~/Scripts/jquery-{version}.js"));
13 |
14 | bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
15 | "~/Scripts/jquery.validate*"));
16 |
17 | // 使用要用于开发和学习的 Modernizr 的开发版本。然后,当你做好
18 | // 生产准备时,请使用 http://modernizr.com 上的生成工具来仅选择所需的测试。
19 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
20 | "~/Scripts/modernizr-*"));
21 |
22 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
23 | "~/Scripts/bootstrap.js",
24 | "~/Scripts/respond.js"));
25 |
26 | bundles.Add(new StyleBundle("~/Content/css").Include(
27 | "~/Content/bootstrap.css",
28 | "~/Content/site.css"));
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/client/dotnetcore/Logging.Client/Thrift/Protocol/TProtocolFactory.cs:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | *
19 | * Contains some contributions under the Thrift Software License.
20 | * Please see doc/old-thrift-license.txt in the Thrift distribution for
21 | * details.
22 | */
23 |
24 | using Thrift.Transport;
25 |
26 | namespace Thrift.Protocol
27 | {
28 | public interface TProtocolFactory
29 | {
30 | TProtocol GetProtocol(TTransport trans);
31 | }
32 | }
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/protocol/TMessageType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.thrift.protocol;
21 |
22 | /**
23 | * Message type constants in the Thrift protocol.
24 | *
25 | */
26 | public final class TMessageType {
27 | public static final byte CALL = 1;
28 | public static final byte REPLY = 2;
29 | public static final byte EXCEPTION = 3;
30 | public static final byte ONEWAY = 4;
31 | }
32 |
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/TProcessor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.thrift;
21 |
22 | import org.apache.thrift.protocol.TProtocol;
23 |
24 | /**
25 | * A processor is a generic object which operates upon an input stream and
26 | * writes to some output stream.
27 | *
28 | */
29 | public interface TProcessor {
30 | public boolean process(TProtocol in, TProtocol out)
31 | throws TException;
32 | }
33 |
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/protocol/TProtocolFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.thrift.protocol;
21 |
22 | import java.io.Serializable;
23 |
24 | import org.apache.thrift.transport.TTransport;
25 |
26 | /**
27 | * Factory interface for constructing protocol instances.
28 | */
29 | public interface TProtocolFactory extends Serializable {
30 | public TProtocol getProtocol(TTransport trans);
31 | }
32 |
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/meta_data/EnumMetaData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.thrift.meta_data;
21 |
22 | import org.apache.thrift.TEnum;
23 |
24 | public class EnumMetaData extends FieldValueMetaData {
25 | public final Class extends TEnum> enumClass;
26 |
27 | public EnumMetaData(byte type, Class extends TEnum> sClass){
28 | super(type);
29 | this.enumClass = sClass;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/server/Logging.Server.Site/Test/MetricTest.aspx.cs:
--------------------------------------------------------------------------------
1 | using Logging.Server.Metric.Processor;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Web;
6 | using System.Web.UI;
7 | using System.Web.UI.WebControls;
8 |
9 | namespace Logging.Server.Site.Test
10 | {
11 | public partial class MetricTest : System.Web.UI.Page
12 | {
13 | protected void Page_Load(object sender, EventArgs e)
14 | {
15 |
16 | }
17 |
18 | protected void Button1_Click(object sender, EventArgs e)
19 | {
20 | var metric = MetricProcessorManager.GetMetricProcessor();
21 |
22 | IList logs = new List();
23 | logs.Add(new MetricEntity { Name= "plu_test_request_count", Value=4110, Time=Utils.GetUnixTime(DateTime.Now) });
24 | logs.Add(new MetricEntity { Name = "plu_test_request_count", Value = 4110, Time = Utils.GetUnixTime(DateTime.Now) });
25 | logs.Add(new MetricEntity { Name = "plu_test_request_count", Value = 4110, Time = Utils.GetUnixTime(DateTime.Now) });
26 | logs.Add(new MetricEntity { Name = "plu_test_request_count", Value = 4110, Time = Utils.GetUnixTime(DateTime.Now) });
27 | metric.Process(logs);
28 |
29 |
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/transport/TNonblockingServerTransport.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 |
21 | package org.apache.thrift.transport;
22 |
23 | import java.nio.channels.Selector;
24 |
25 | /**
26 | * Server transport that can be operated in a nonblocking fashion.
27 | */
28 | public abstract class TNonblockingServerTransport extends TServerTransport {
29 |
30 | public abstract void registerSelector(Selector selector);
31 | }
32 |
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/meta_data/StructMetaData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.thrift.meta_data;
21 |
22 | import org.apache.thrift.TBase;
23 |
24 | public class StructMetaData extends FieldValueMetaData {
25 | public final Class extends TBase> structClass;
26 |
27 | public StructMetaData(byte type, Class extends TBase> sClass){
28 | super(type);
29 | this.structClass = sClass;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/TFieldIdEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.thrift;
20 |
21 | /**
22 | * Interface for all generated struct Fields objects.
23 | */
24 | public interface TFieldIdEnum {
25 | /**
26 | * Get the Thrift field id for the named field.
27 | */
28 | public short getThriftFieldId();
29 |
30 | /**
31 | * Get the field's name, exactly as in the IDL.
32 | */
33 | public String getFieldName();
34 | }
35 |
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/scheme/IScheme.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.thrift.scheme;
20 |
21 | import org.apache.thrift.TBase;
22 |
23 | public interface IScheme {
24 |
25 | public void read(org.apache.thrift.protocol.TProtocol iproto, T struct) throws org.apache.thrift.TException;
26 |
27 | public void write(org.apache.thrift.protocol.TProtocol oproto, T struct) throws org.apache.thrift.TException;
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/client/dotnetcore/Logging.Client/LogEntity.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Logging.Client
4 | {
5 | internal interface ILogEntity
6 | {
7 | ///
8 | /// 类型:1Log;2:Metric
9 | ///
10 | int Type { get; set; }
11 | }
12 |
13 | public class LogEntity : ILogEntity
14 | {
15 | public int Type { get; set; }
16 |
17 | public LogEntity()
18 | {
19 | this.Type = 1;
20 | }
21 |
22 | public string Title { get; set; }
23 |
24 | public string Message { get; set; }
25 |
26 | public LogLevel Level { get; set; }
27 |
28 | public long Time { get; set; }
29 |
30 | public string Source { get; set; }
31 |
32 | public int Thread { get; set; }
33 |
34 | public Dictionary Tags { get; set; }
35 | }
36 |
37 | public class MetricEntity : ILogEntity
38 | {
39 | public MetricEntity()
40 | {
41 | this.Type = 2;
42 | }
43 |
44 | public int Type { get; set; }
45 |
46 | public string Name { get; set; }
47 |
48 | public double Value { get; set; }
49 |
50 | public long Time { get; set; }
51 |
52 | public Dictionary Tags { get; set; }
53 | }
54 | }
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/protocol/TList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.thrift.protocol;
21 |
22 | /**
23 | * Helper class that encapsulates list metadata.
24 | *
25 | */
26 | public final class TList {
27 | public TList() {
28 | this(TType.STOP, 0);
29 | }
30 |
31 | public TList(byte t, int s) {
32 | elemType = t;
33 | size = s;
34 | }
35 |
36 | public final byte elemType;
37 | public final int size;
38 | }
39 |
--------------------------------------------------------------------------------
/contract/Logging.ThriftContract/obj/Debug/Logging.ThriftContract.csproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | D:\WorkStudio\Logging\Logging.ThriftContract\bin\Debug\Logging.ThriftContract.dll
2 | D:\WorkStudio\Logging\Logging.ThriftContract\bin\Debug\Logging.ThriftContract.pdb
3 | D:\WorkStudio\Logging\Logging.ThriftContract\bin\Debug\Thrift.dll
4 | D:\WorkStudio\Logging\Logging.ThriftContract\bin\Debug\Thrift.pdb
5 | D:\WorkStudio\Logging\Logging.ThriftContract\obj\Debug\Logging.ThriftContract.csprojResolveAssemblyReference.cache
6 | D:\WorkStudio\Logging\Logging.ThriftContract\obj\Debug\Logging.ThriftContract.dll
7 | D:\WorkStudio\Logging\Logging.ThriftContract\obj\Debug\Logging.ThriftContract.pdb
8 | D:\workstudio\Logging\contract\Logging.ThriftContract\bin\Debug\Logging.ThriftContract.dll
9 | D:\workstudio\Logging\contract\Logging.ThriftContract\bin\Debug\Logging.ThriftContract.pdb
10 | D:\workstudio\Logging\contract\Logging.ThriftContract\bin\Debug\Thrift.dll
11 | D:\workstudio\Logging\contract\Logging.ThriftContract\bin\Debug\Thrift.pdb
12 | D:\workstudio\Logging\contract\Logging.ThriftContract\obj\Debug\Logging.ThriftContract.csprojResolveAssemblyReference.cache
13 | D:\workstudio\Logging\contract\Logging.ThriftContract\obj\Debug\Logging.ThriftContract.dll
14 | D:\workstudio\Logging\contract\Logging.ThriftContract\obj\Debug\Logging.ThriftContract.pdb
15 |
--------------------------------------------------------------------------------
/server/Logging.Server.Site/StatisticsViewer.ashx.cs:
--------------------------------------------------------------------------------
1 | using Logging.Server.Viewer;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Web;
6 |
7 | namespace Logging.Server.Site
8 | {
9 | ///
10 | /// StatisticsViewer 的摘要说明
11 | ///
12 | public class StatisticsViewer : IHttpHandler
13 | {
14 |
15 | public void ProcessRequest(HttpContext context)
16 | {
17 | context.Response.ContentType = "text/plain";
18 | long start = Convert.ToInt64(context.Request["start"]);
19 | long end = Convert.ToInt64(context.Request["end"]);
20 | int appId = Convert.ToInt32(context.Request["appId"]);
21 |
22 | //long start_num = Utils.GetTimeStamp(start);
23 |
24 | //long end_num = Utils.GetTimeStamp(end);
25 |
26 | var viewer = LogViewerManager.GetLogViewer();
27 |
28 | var s = viewer.GetStatistics(start, end, appId);
29 | context.Response.AddHeader("Access-Control-Allow-Origin", "*");//允许跨域请求
30 | context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(s));
31 | }
32 |
33 | public bool IsReusable
34 | {
35 | get
36 | {
37 | return false;
38 | }
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/server/Logging.Server.Web/Logging.Server.Web.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | true
5 | ProjectFiles
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | CurrentPage
14 | True
15 | False
16 | False
17 | False
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | True
27 | True
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/server/Logging.Server.Web/Content/alerting.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 | var init = function () {
3 | $.get("api/GetAppErrOpts", function (data) {
4 | var result = eval("(" + data + ")")
5 | $("#app_err_interval").val(result.ALERTING_APPERROR_INTERVAL);
6 | $("#app_err_errorCountLimit").val(result.ALERTING_APPERROR_ERRORCOUNTLIMIT);
7 | $("#app_err_errorGrowthLimit").val(result.ALERTING_APPERROR_ERRORGROWTHLIMIT);
8 | $("#app_err_emailReceivers").val(result.ALERTING_APPERROR_EMAILRECEIVERS);
9 | });
10 |
11 | $("#btn_ok").click(function () {
12 | setOpts();
13 | });
14 | }
15 |
16 | var setOpts = function () {
17 | var interval = $("#app_err_interval").val();
18 | var errorCountLimit = $("#app_err_errorCountLimit").val();
19 | var errorGrowthLimit = $("#app_err_errorGrowthLimit").val();
20 | var emailReceivers = $("#app_err_emailReceivers").val();
21 |
22 | var data = {
23 | interval: interval,
24 | errorCountLimit: errorCountLimit,
25 | errorGrowthLimit: errorGrowthLimit,
26 | emailReceivers: emailReceivers
27 | };
28 |
29 | $.get("api/SetAppErrOpts", data, function () {
30 | alert("OK");
31 | });
32 | }
33 |
34 | init();
35 | });
--------------------------------------------------------------------------------
/server/Logging.Server/Entitys/LogEntity.cs:
--------------------------------------------------------------------------------
1 | using MongoDB.Bson;
2 | using System.Collections.Generic;
3 |
4 | namespace Logging.Server
5 | {
6 | public class LogEntity
7 | {
8 | public ObjectId _id { get; set; }
9 |
10 | public string Title { get; set; }
11 |
12 | public string Message { get; set; }
13 |
14 | public long IP { get; set; }
15 |
16 | public LogLevel Level { get; set; }
17 |
18 | public int AppId { get; set; }
19 |
20 | public long Time { get; set; }
21 |
22 | public string Source { get; set; }
23 |
24 | public int Thread { get; set; }
25 |
26 | public List Tags { get; set; }
27 | }
28 |
29 | public class LogEntityComparer : IComparer
30 | {
31 | public int Compare(LogEntity x, LogEntity y)
32 | {
33 | if (x == null && y == null) return 0;
34 | if (x == null) return 1;
35 | if (y == null) return -1;
36 |
37 | if (x.Time > y.Time) return -1;
38 | if (x.Time < y.Time) return 1;
39 |
40 | if (x.Time == y.Time)
41 | {
42 | if (x._id.Increment > y._id.Increment) return -1;
43 | if (x._id.Increment < y._id.Increment) return 1;
44 | }
45 |
46 | return 0;
47 | }
48 | }
49 | }
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/meta_data/MapMetaData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.thrift.meta_data;
21 |
22 | public class MapMetaData extends FieldValueMetaData {
23 | public final FieldValueMetaData keyMetaData;
24 | public final FieldValueMetaData valueMetaData;
25 |
26 | public MapMetaData(byte type, FieldValueMetaData kMetaData, FieldValueMetaData vMetaData){
27 | super(type);
28 | this.keyMetaData = kMetaData;
29 | this.valueMetaData = vMetaData;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/server/Logging.Server.Site/alerting/alerting.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 |
3 | var init = function () {
4 | $.get("GetAppErrOpts.ashx", function (data) {
5 |
6 | var result = eval("(" + data + ")")
7 | $("#app_err_interval").val(result.ALERTING_APPERROR_INTERVAL);
8 | $("#app_err_errorCountLimit").val(result.ALERTING_APPERROR_ERRORCOUNTLIMIT);
9 | $("#app_err_errorGrowthLimit").val(result.ALERTING_APPERROR_ERRORGROWTHLIMIT);
10 | $("#app_err_emailReceivers").val(result.ALERTING_APPERROR_EMAILRECEIVERS);
11 | });
12 |
13 | $("#btn_ok").click(function () {
14 | setOpts();
15 | });
16 |
17 | }
18 |
19 | var setOpts = function () {
20 |
21 | var interval = $("#app_err_interval").val();
22 | var errorCountLimit = $("#app_err_errorCountLimit").val();
23 | var errorGrowthLimit = $("#app_err_errorGrowthLimit").val();
24 | var emailReceivers = $("#app_err_emailReceivers").val();
25 |
26 | var data = {
27 | interval: interval,
28 | errorCountLimit: errorCountLimit,
29 | errorGrowthLimit: errorGrowthLimit,
30 | emailReceivers: emailReceivers
31 | };
32 |
33 | $.get("SetAppErrOpts.ashx", data, function () {
34 | alert("OK");
35 | });
36 |
37 | }
38 |
39 | init();
40 | });
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/protocol/TMap.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.thrift.protocol;
21 |
22 | /**
23 | * Helper class that encapsulates map metadata.
24 | *
25 | */
26 | public final class TMap {
27 | public TMap() {
28 | this(TType.STOP, TType.STOP, 0);
29 | }
30 |
31 | public TMap(byte k, byte v, int s) {
32 | keyType = k;
33 | valueType = v;
34 | size = s;
35 | }
36 |
37 | public final byte keyType;
38 | public final byte valueType;
39 | public final int size;
40 | }
41 |
--------------------------------------------------------------------------------
/client/csharp/Logging.Client.TestSite/Logging.Client.TestSite.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | release.client.logging.plu.cn
5 | true
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | CurrentPage
14 | True
15 | False
16 | False
17 | False
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | True
27 | True
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/client/csharp/Logging.Client/LogManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Concurrent;
3 |
4 | namespace Logging.Client
5 | {
6 | public sealed class LogManager
7 | {
8 | static ConcurrentDictionary _logs = new ConcurrentDictionary();
9 |
10 |
11 | private LogManager()
12 | { }
13 |
14 | ///
15 | /// 通过类型名获取ILog实例。
16 | ///
17 | /// The type.
18 | /// ILog instance
19 | public static ILog GetLogger(Type type)
20 | {
21 | if (type == null)
22 | {
23 | return GetLogger("NoName");
24 | }
25 | else
26 | {
27 | return GetLogger(type.FullName);
28 | }
29 | }
30 |
31 | ///
32 | /// 通过字符串名获取ILog实例。
33 | ///
34 | /// The name.
35 | /// ILog instance
36 | public static ILog GetLogger(string name)
37 | {
38 | ILog log;
39 | var has = _logs.TryGetValue(name, out log);
40 | if (!has)
41 | {
42 | log = new SimpleLogger(name);
43 | _logs.TryAdd(name, log);
44 | }
45 | return log;
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/protocol/TSet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.thrift.protocol;
21 |
22 | /**
23 | * Helper class that encapsulates set metadata.
24 | *
25 | */
26 | public final class TSet {
27 | public TSet() {
28 | this(TType.STOP, 0);
29 | }
30 |
31 | public TSet(byte t, int s) {
32 | elemType = t;
33 | size = s;
34 | }
35 |
36 | public TSet(TList list) {
37 | this(list.elemType, list.size);
38 | }
39 |
40 | public final byte elemType;
41 | public final int size;
42 | }
43 |
--------------------------------------------------------------------------------
/client/dotnetcore/Logging.Client/LogManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Concurrent;
3 |
4 | namespace Logging.Client
5 | {
6 | public sealed class LogManager
7 | {
8 | private static ConcurrentDictionary _logs = new ConcurrentDictionary();
9 |
10 | private LogManager()
11 | { }
12 |
13 | ///
14 | /// 通过类型名获取ILog实例。
15 | ///
16 | /// The type.
17 | /// ILog instance
18 | public static ILog GetLogger(Type type)
19 | {
20 | if (type == null)
21 | {
22 | return GetLogger("NoName");
23 | }
24 | else
25 | {
26 | return GetLogger(type.FullName);
27 | }
28 | }
29 |
30 | ///
31 | /// 通过字符串名获取ILog实例。
32 | ///
33 | /// The name.
34 | /// ILog instance
35 | public static ILog GetLogger(string name)
36 | {
37 | ILog log;
38 | var has = _logs.TryGetValue(name, out log);
39 | if (!has)
40 | {
41 | log = new SimpleLogger(name);
42 | _logs.TryAdd(name, log);
43 | }
44 | return log;
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/client/java/logging.client/src/main/java/org/apache/thrift/transport/TSeekableFile.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.thrift.transport;
21 |
22 | import java.io.InputStream;
23 | import java.io.OutputStream;
24 | import java.io.IOException;
25 |
26 | public interface TSeekableFile {
27 |
28 | public InputStream getInputStream() throws IOException;
29 | public OutputStream getOutputStream() throws IOException;
30 | public void close() throws IOException;
31 | public long length() throws IOException;
32 | public void seek(long pos) throws IOException;
33 | }
34 |
--------------------------------------------------------------------------------
/client/go/loggingclient/thrift/server.go:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package thrift
21 |
22 | type TServer interface {
23 | ProcessorFactory() TProcessorFactory
24 | ServerTransport() TServerTransport
25 | InputTransportFactory() TTransportFactory
26 | OutputTransportFactory() TTransportFactory
27 | InputProtocolFactory() TProtocolFactory
28 | OutputProtocolFactory() TProtocolFactory
29 |
30 | // Starts the server
31 | Serve() error
32 | // Stops the server. This is optional on a per-implementation basis. Not
33 | // all servers are required to be cleanly stoppable.
34 | Stop() error
35 | }
36 |
--------------------------------------------------------------------------------
/server/Logging.Server.Site/Logging.Server.Site.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | true
5 | ProjectFiles
6 | release.server.logging.plu.cn
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | CurrentPage
15 | True
16 | False
17 | False
18 | False
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | True
28 | True
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/client/java/logging.client/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/contract/Thrift/Thrift/Protocol/TType.cs:
--------------------------------------------------------------------------------
1 | /**
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | *
19 | * Contains some contributions under the Thrift Software License.
20 | * Please see doc/old-thrift-license.txt in the Thrift distribution for
21 | * details.
22 | */
23 |
24 | namespace Thrift.Protocol
25 | {
26 | public enum TType : byte
27 | {
28 | Stop = 0,
29 | Void = 1,
30 | Bool = 2,
31 | Byte = 3,
32 | Double = 4,
33 | I16 = 6,
34 | I32 = 8,
35 | I64 = 10,
36 | String = 11,
37 | Struct = 12,
38 | Map = 13,
39 | Set = 14,
40 | List = 15
41 | }
42 | }
--------------------------------------------------------------------------------
/client/csharp/Logging.Client/LogSender/THttpLogSender.cs:
--------------------------------------------------------------------------------
1 | using Logging.ThriftContract;
2 | using System;
3 | using System.Collections.Generic;
4 | using Thrift.Protocol;
5 | using Thrift.Transport;
6 |
7 | namespace Logging.Client
8 | {
9 | ///
10 | /// Thrift Http协议发送消息
11 | ///
12 | internal class THttpLogSender : LogSenderBase
13 | {
14 | private readonly static string loggingServerHost = Settings.LoggingServerHost;
15 | private readonly static Uri uri = new Uri(loggingServerHost + "/Reciver.ashx");
16 | private readonly static long TransDataSizeLimit = 1 * 1024 * 1024L;
17 |
18 | public override long Send(IList logEntities)
19 | {
20 | if (logEntities == null || logEntities.Count <= 0) { return 0; }
21 |
22 | TLogPackage logPackage = this.CreateLogPackage(logEntities);
23 |
24 | var trans = new THttpClient(uri);
25 | trans.ConnectTimeout = SENDER_TIMEOUT;
26 | trans.DataSizeLimit = TransDataSizeLimit;
27 | //var protocol = new TBinaryProtocol(httpClient);
28 | var protocol = new TCompactProtocol(trans);
29 | trans.Open();
30 |
31 | var client = new LogTransferService.Client(protocol);
32 | client.Log(logPackage);
33 |
34 | long data_size = trans.DataSize;
35 |
36 | trans.Close();
37 | return data_size;
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------