├── server ├── Logging.Server.Web │ ├── Content │ │ ├── js │ │ │ └── site.min.js │ │ ├── css │ │ │ └── site.min.css │ │ ├── favicon.ico │ │ ├── jQuery │ │ │ └── css │ │ │ │ └── images │ │ │ │ ├── ui-icons_222222_256x240.png │ │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ │ ├── ui-icons_454545_256x240.png │ │ │ │ ├── ui-icons_888888_256x240.png │ │ │ │ ├── ui-icons_cd0a0a_256x240.png │ │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ │ └── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ ├── bootstrap │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ └── js │ │ │ │ └── npm.js │ │ └── alerting.js │ ├── Views │ │ ├── _ViewStart.cshtml │ │ ├── Home │ │ │ └── Index.cshtml │ │ └── Shared │ │ │ ├── _Layout.cshtml │ │ │ └── Error.cshtml │ ├── favicon.ico │ ├── Reciver.ashx │ ├── Global.asax │ ├── Reciver.ashx.cs │ ├── Controllers │ │ ├── HomeController.cs │ │ ├── LogVM.cs │ │ ├── AlertingController.cs │ │ ├── MetricsController.cs │ │ ├── SettingsController.cs │ │ └── LogViewerController.cs │ ├── App_Start │ │ ├── FilterConfig.cs │ │ ├── BundleConfig.cs │ │ ├── RouteConfig.cs │ │ └── WebApiConfig.cs │ ├── Startup.cs │ ├── Global.asax.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Web.Debug.config │ ├── Web.Release.config │ └── Logging.Server.Web.csproj.user ├── Logging.Server.Site │ ├── favicon.ico │ ├── Global.asax │ ├── Reciver.ashx │ ├── LogViewer.ashx │ ├── GetLogOnOff.ashx │ ├── SetLogOnOff.ashx │ ├── metrics │ │ ├── Point.ashx │ │ ├── MetricTags.ashx │ │ ├── MetricsQuery.ashx │ │ ├── test.aspx │ │ └── test.aspx.designer.cs │ ├── GetLogOnOffs.ashx │ ├── StatisticsPeriod.ashx │ ├── StatisticsViewer.ashx │ ├── alerting │ │ ├── GetAppErrOpts.ashx │ │ ├── SetAppErrOpts.ashx │ │ ├── GetAppErrOpts.ashx.cs │ │ ├── SetAppErrOpts.ashx.cs │ │ └── alerting.js │ ├── Content │ │ ├── jQuery │ │ │ └── css │ │ │ │ └── images │ │ │ │ ├── ui-icons_222222_256x240.png │ │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ │ ├── ui-icons_454545_256x240.png │ │ │ │ ├── ui-icons_888888_256x240.png │ │ │ │ ├── ui-icons_cd0a0a_256x240.png │ │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ │ └── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ └── bootstrap │ │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ └── js │ │ │ └── npm.js │ ├── Reciver.ashx.cs │ ├── Index.html │ ├── App_Start │ │ ├── FilterConfig.cs │ │ ├── WebApiConfig.cs │ │ ├── RouteConfig.cs │ │ └── BundleConfig.cs │ ├── Test │ │ ├── MetricTest.aspx │ │ ├── MetricTest.aspx.designer.cs │ │ └── MetricTest.aspx.cs │ ├── InfluxData.Net.dll.config │ ├── MongoTools.aspx │ ├── GetLogOnOffs.ashx.cs │ ├── Properties │ │ ├── PublishProfiles │ │ │ └── release.server.logging.plu.cn.pubxml │ │ └── AssemblyInfo.cs │ ├── Global.asax.cs │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── StatisticsViewer.ashx.cs │ └── Logging.Server.Site.csproj.user └── Logging.Server │ ├── Entitys │ ├── LogLevel.cs │ ├── LogTag.cs │ ├── Options.cs │ ├── MetricEntity.cs │ ├── LogStatistics.cs │ ├── LogOnOff.cs │ ├── OptionKeys.cs │ └── LogEntity.cs │ ├── Logging.Server.csproj.user │ ├── Alerting │ ├── AlertingType.cs │ ├── AlertingHistory.cs │ └── BaseAlerting.cs │ ├── LogProcessor │ ├── ILogProcessor.cs │ ├── LogProcessorManager.cs │ └── DefaultLogProcessor.cs │ ├── packages.config │ ├── Metric │ ├── MetricProcessor │ │ ├── IMetricProcessor.cs │ │ ├── MetricProcessorManager.cs │ │ └── DefaulMetricProcessor.cs │ ├── Json │ │ └── JsonObject.cs │ └── Config.cs │ ├── LogReciver │ ├── HttpReciver.cs │ └── SocketReciver.cs │ ├── LogWriter │ ├── ILogWriter.cs │ ├── HBaseWriter.cs │ └── LogWriterManager.cs │ ├── LogViewer │ ├── LogViewerManager.cs │ ├── ILogView.cs │ └── HBaseViewer.cs │ ├── Properties │ └── AssemblyInfo.cs │ └── BackgroundTask.cs ├── contract ├── Logging.ThriftContract │ ├── obj │ │ ├── Release │ │ │ ├── build.force │ │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ │ └── Debug │ │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ │ ├── Logging.ThriftContract.dll │ │ │ ├── Logging.ThriftContract.pdb │ │ │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ │ │ ├── Logging.ThriftContract.csprojResolveAssemblyReference.cache │ │ │ └── Logging.ThriftContract.csproj.FileListAbsolute.txt │ ├── log.thrift │ ├── bin │ │ └── Debug │ │ │ ├── Thrift.dll │ │ │ ├── Thrift.pdb │ │ │ ├── Logging.ThriftContract.dll │ │ │ └── Logging.ThriftContract.pdb │ └── Properties │ │ └── AssemblyInfo.cs └── Thrift │ ├── obj │ ├── Debug │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ ├── Thrift.dll │ │ ├── Thrift.pdb │ │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ │ └── Thrift.csproj.FileListAbsolute.txt │ └── Release │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ └── DesignTimeResolveAssemblyReferencesInput.cache │ ├── Thrift │ ├── TException.cs │ ├── Transport │ │ └── TTransport.cs │ ├── Protocol │ │ ├── TMessageType.cs │ │ ├── TAbstractBase.cs │ │ ├── TBase.cs │ │ ├── TProtocolFactory.cs │ │ └── TType.cs │ └── TProcessor.cs │ ├── bin │ └── Debug │ │ ├── Thrift.dll │ │ └── Thrift.pdb │ ├── Thrift.csproj.user │ └── Properties │ └── AssemblyInfo.cs ├── .nuget ├── NuGet.exe └── NuGet.Config ├── Logging.v11.suo ├── Logging.v12.suo ├── client ├── java │ ├── logging.client.test │ │ ├── build │ │ │ └── classes │ │ │ │ ├── META-INF │ │ │ │ └── MANIFEST.MF │ │ │ │ └── Main.class │ │ ├── appClientModule │ │ │ └── META-INF │ │ │ │ └── MANIFEST.MF │ │ ├── .idea │ │ │ ├── copyright │ │ │ │ └── profiles_settings.xml │ │ │ ├── libraries │ │ │ │ └── logging_client.xml │ │ │ ├── modules.xml │ │ │ └── compiler.xml │ │ ├── lib │ │ │ └── logging.client.jar │ │ ├── .settings │ │ │ ├── org.eclipse.wst.common.project.facet.core.xml │ │ │ ├── org.eclipse.jdt.core.prefs │ │ │ └── org.eclipse.wst.common.component │ │ ├── .classpath │ │ └── .project │ └── logging.client │ │ ├── src │ │ └── main │ │ │ ├── java │ │ │ ├── META-INF │ │ │ │ └── MANIFEST.MF │ │ │ ├── logging │ │ │ │ └── client │ │ │ │ │ ├── ITimerActionBlock.java │ │ │ │ │ ├── ILogEntity.java │ │ │ │ │ ├── SimpleLogger.java │ │ │ │ │ ├── LogOnOff.java │ │ │ │ │ ├── MetricEntity.java │ │ │ │ │ ├── LogEntity.java │ │ │ │ │ ├── App.java │ │ │ │ │ ├── THttpLogSender.java │ │ │ │ │ └── LogManager.java │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── thrift │ │ │ │ ├── slf │ │ │ │ ├── LoggerFactory.java │ │ │ │ └── Logger.java │ │ │ │ ├── server │ │ │ │ ├── Invocation.java │ │ │ │ └── ServerContext.java │ │ │ │ ├── TEnum.java │ │ │ │ ├── scheme │ │ │ │ ├── SchemeFactory.java │ │ │ │ ├── TupleScheme.java │ │ │ │ ├── StandardScheme.java │ │ │ │ └── IScheme.java │ │ │ │ ├── async │ │ │ │ └── TAsyncClientFactory.java │ │ │ │ ├── TFieldRequirementType.java │ │ │ │ ├── meta_data │ │ │ │ ├── ListMetaData.java │ │ │ │ ├── SetMetaData.java │ │ │ │ ├── EnumMetaData.java │ │ │ │ ├── StructMetaData.java │ │ │ │ └── MapMetaData.java │ │ │ │ ├── protocol │ │ │ │ ├── TStruct.java │ │ │ │ ├── TMessageType.java │ │ │ │ ├── TProtocolFactory.java │ │ │ │ ├── TList.java │ │ │ │ ├── TMap.java │ │ │ │ └── TSet.java │ │ │ │ ├── TProcessor.java │ │ │ │ ├── transport │ │ │ │ ├── TNonblockingServerTransport.java │ │ │ │ └── TSeekableFile.java │ │ │ │ └── TFieldIdEnum.java │ │ │ └── main.iml │ │ ├── .idea │ │ ├── encodings.xml │ │ ├── modules.xml │ │ ├── artifacts │ │ │ └── logging_client_jar.xml │ │ └── compiler.xml │ │ ├── .gitattributes │ │ ├── logging.client.iml │ │ ├── .gitignore │ │ ├── .project │ │ ├── settings.xml │ │ ├── pom.xml │ │ └── .classpath ├── go │ └── loggingclient │ │ ├── ILogEntity.go │ │ ├── ILogSender.go │ │ ├── LogLevel.go │ │ ├── LogSenderManager.go │ │ ├── LogOnOff.go │ │ ├── .vscode │ │ └── launch.json │ │ ├── loggingclient.config.template │ │ ├── constants.go │ │ ├── MetricEntity.go │ │ ├── LogEntity.go │ │ ├── ILog.go │ │ ├── thrift │ │ ├── exception.go │ │ ├── protocol_factory.go │ │ ├── processor.go │ │ ├── messagetype.go │ │ └── server.go │ │ ├── LogManager.go │ │ └── Utils.go ├── dotnetcore │ └── Logging.Client │ │ ├── .vs │ │ └── restore.dg │ │ ├── obj │ │ ├── Release │ │ │ └── netstandard1.6 │ │ │ │ ├── .SDKVersion │ │ │ │ └── dotnet-compile.assemblyinfo.cs │ │ └── Debug │ │ │ └── netstandard1.6 │ │ │ ├── .SDKVersion │ │ │ └── dotnet-compile.assemblyinfo.cs │ │ ├── Thrift │ │ ├── TException.cs │ │ ├── Transport │ │ │ └── TTransport.cs │ │ ├── Protocol │ │ │ ├── TMessageType.cs │ │ │ ├── TAbstractBase.cs │ │ │ ├── TBase.cs │ │ │ └── TProtocolFactory.cs │ │ └── TProcessor.cs │ │ ├── ThriftContract │ │ └── log.thrift │ │ ├── Widgets │ │ └── IWidget.cs │ │ ├── bin │ │ ├── Debug │ │ │ └── netstandard1.6 │ │ │ │ ├── Logging.Client.dll │ │ │ │ └── Logging.Client.pdb │ │ └── Release │ │ │ └── netstandard1.6 │ │ │ ├── Logging.Client.dll │ │ │ └── Logging.Client.pdb │ │ ├── LogLevel.cs │ │ ├── Logger │ │ ├── ITimerActionBlock.cs │ │ └── SimpleLogger.cs │ │ ├── LogSender │ │ ├── LogSenderResult.cs │ │ └── LogSenderManager.cs │ │ ├── Logging.Client.xproj.user │ │ ├── LogOnOff.cs │ │ ├── project.json │ │ ├── System │ │ ├── Web │ │ │ └── IHttpHandler.cs │ │ └── SerializableAttribute.cs │ │ ├── ConfigurationManager.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── Logging.Client.sln │ │ ├── Logging.Client.xproj │ │ ├── LogEntity.cs │ │ └── LogManager.cs └── csharp │ ├── Logging.Client.TestSite │ ├── Global.asax │ ├── Default.aspx │ ├── Default.aspx.designer.cs │ ├── Properties │ │ ├── PublishProfiles │ │ │ ├── release.client.logging.plu.cn.pubxml │ │ │ └── release.client.logging.plu.cn.pubxml.user │ │ └── AssemblyInfo.cs │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ └── Logging.Client.TestSite.csproj.user │ └── Logging.Client │ ├── LogLevel.cs │ ├── Logger │ ├── ITimerActionBlock.cs │ └── SimpleLogger.cs │ ├── Logging.Client.csproj.user │ ├── Tags.cs │ ├── Widgets │ └── IWidget.cs │ ├── LogSender │ ├── LogSenderResult.cs │ ├── LogSenderManager.cs │ └── THttpLogSender.cs │ ├── LogOnOff.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── WebClientEx.cs │ ├── LogEntity.cs │ └── LogManager.cs ├── .gitattributes └── .gitignore /server/Logging.Server.Web/Content/js/site.min.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/css/site.min.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /contract/Logging.ThriftContract/obj/Release/build.force: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/.nuget/NuGet.exe -------------------------------------------------------------------------------- /Logging.v11.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/Logging.v11.suo -------------------------------------------------------------------------------- /Logging.v12.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/Logging.v12.suo -------------------------------------------------------------------------------- /contract/Thrift/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /contract/Thrift/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /contract/Thrift/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /contract/Thrift/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /contract/Thrift/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /contract/Thrift/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /contract/Logging.ThriftContract/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /contract/Logging.ThriftContract/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /contract/Logging.ThriftContract/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /contract/Logging.ThriftContract/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /contract/Logging.ThriftContract/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /contract/Logging.ThriftContract/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/Logging.Server.Web/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /client/java/logging.client.test/build/classes/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Main-Class: Main 3 | 4 | -------------------------------------------------------------------------------- /client/java/logging.client.test/appClientModule/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Main-Class: Main 3 | 4 | -------------------------------------------------------------------------------- /client/go/loggingclient/ILogEntity.go: -------------------------------------------------------------------------------- 1 | package loggingclient 2 | 3 | type ILogEntity interface { 4 | getType() int 5 | } 6 | -------------------------------------------------------------------------------- /client/java/logging.client/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Main-Class: logging.client.App 3 | 4 | -------------------------------------------------------------------------------- /contract/Thrift/Thrift/TException.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/contract/Thrift/Thrift/TException.cs -------------------------------------------------------------------------------- /contract/Thrift/bin/Debug/Thrift.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/contract/Thrift/bin/Debug/Thrift.dll -------------------------------------------------------------------------------- /contract/Thrift/bin/Debug/Thrift.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/contract/Thrift/bin/Debug/Thrift.pdb -------------------------------------------------------------------------------- /contract/Thrift/obj/Debug/Thrift.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/contract/Thrift/obj/Debug/Thrift.dll -------------------------------------------------------------------------------- /contract/Thrift/obj/Debug/Thrift.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/contract/Thrift/obj/Debug/Thrift.pdb -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/.vs/restore.dg: -------------------------------------------------------------------------------- 1 | #:D:\workstudio\Logging\client\dotnetcore\Logging.Client\Logging.Client.xproj 2 | -------------------------------------------------------------------------------- /server/Logging.Server.Site/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Site/favicon.ico -------------------------------------------------------------------------------- /server/Logging.Server.Web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Web/favicon.ico -------------------------------------------------------------------------------- /contract/Logging.ThriftContract/log.thrift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/contract/Logging.ThriftContract/log.thrift -------------------------------------------------------------------------------- /server/Logging.Server.Site/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Logging.Server.Site.Global" Language="C#" %> 2 | -------------------------------------------------------------------------------- /server/Logging.Server.Site/Reciver.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="C#" CodeBehind="Reciver.ashx.cs" Class="Logging.Server.Site.Reciver" %> 2 | -------------------------------------------------------------------------------- /server/Logging.Server.Web/Reciver.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="C#" CodeBehind="Reciver.ashx.cs" Class="Logging.Server.Site.Reciver" %> 2 | -------------------------------------------------------------------------------- /contract/Thrift/Thrift/Transport/TTransport.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/contract/Thrift/Thrift/Transport/TTransport.cs -------------------------------------------------------------------------------- /server/Logging.Server.Site/LogViewer.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="C#" CodeBehind="LogViewer.ashx.cs" Class="Logging.Server.Site.LogViewer" %> 2 | -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Web/Content/favicon.ico -------------------------------------------------------------------------------- /server/Logging.Server.Web/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Logging.Server.Web.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /client/java/logging.client.test/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /server/Logging.Server.Site/GetLogOnOff.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="C#" CodeBehind="GetLogOnOff.ashx.cs" Class="Logging.Server.Site.GetLogOnOff" %> 2 | -------------------------------------------------------------------------------- /server/Logging.Server.Site/SetLogOnOff.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="C#" CodeBehind="SetLogOnOff.ashx.cs" Class="Logging.Server.Site.SetLogOnOff" %> 2 | -------------------------------------------------------------------------------- /server/Logging.Server.Site/metrics/Point.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="C#" CodeBehind="Point.ashx.cs" Class="Logging.Server.Site.metrics.Point" %> 2 | -------------------------------------------------------------------------------- /client/csharp/Logging.Client.TestSite/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Logging.Client.TestSite.Global" Language="C#" %> 2 | -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/obj/Release/netstandard1.6/.SDKVersion: -------------------------------------------------------------------------------- 1 | 1e9d529bc54ed49f33102199e109526ea9c6b3c4 2 | 1.0.0-preview2-003121 3 | 4 | win10-x64 -------------------------------------------------------------------------------- /server/Logging.Server.Site/GetLogOnOffs.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="C#" CodeBehind="GetLogOnOffs.ashx.cs" Class="Logging.Server.Site.GetLogOnOffs" %> 2 | -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/Thrift/TException.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/client/dotnetcore/Logging.Client/Thrift/TException.cs -------------------------------------------------------------------------------- /client/java/logging.client.test/lib/logging.client.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/client/java/logging.client.test/lib/logging.client.jar -------------------------------------------------------------------------------- /contract/Logging.ThriftContract/bin/Debug/Thrift.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/contract/Logging.ThriftContract/bin/Debug/Thrift.dll -------------------------------------------------------------------------------- /contract/Logging.ThriftContract/bin/Debug/Thrift.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/contract/Logging.ThriftContract/bin/Debug/Thrift.pdb -------------------------------------------------------------------------------- /client/java/logging.client.test/build/classes/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/client/java/logging.client.test/build/classes/Main.class -------------------------------------------------------------------------------- /server/Logging.Server.Site/StatisticsPeriod.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="C#" CodeBehind="StatisticsPeriod.ashx.cs" Class="Logging.Server.Site.StatisticsPeriod" %> 2 | -------------------------------------------------------------------------------- /server/Logging.Server.Site/StatisticsViewer.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="C#" CodeBehind="StatisticsViewer.ashx.cs" Class="Logging.Server.Site.StatisticsViewer" %> 2 | -------------------------------------------------------------------------------- /server/Logging.Server.Site/metrics/MetricTags.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="C#" CodeBehind="MetricTags.ashx.cs" Class="Logging.Server.Site.metrics.MetricTags" %> 2 | -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/ThriftContract/log.thrift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/client/dotnetcore/Logging.Client/ThriftContract/log.thrift -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/obj/Debug/netstandard1.6/.SDKVersion: -------------------------------------------------------------------------------- 1 | a2df9c2576b79cc713967e5b801c30e7f30b9c9b 2 | 1.0.0-preview2-1-003177 3 | win10-x64 4 | 5 | win7-x64 -------------------------------------------------------------------------------- /client/go/loggingclient/ILogSender.go: -------------------------------------------------------------------------------- 1 | package loggingclient 2 | 3 | import "container/list" 4 | 5 | type ILogSender interface { 6 | send(iLogEntities list.List) 7 | } 8 | -------------------------------------------------------------------------------- /server/Logging.Server.Site/metrics/MetricsQuery.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="C#" CodeBehind="MetricsQuery.ashx.cs" Class="Logging.Server.Site.metrics.MetricsQuery" %> 2 | -------------------------------------------------------------------------------- /server/Logging.Server.Site/alerting/GetAppErrOpts.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="C#" CodeBehind="GetAppErrOpts.ashx.cs" Class="Logging.Server.Site.alerting.GetAppErrOpts" %> 2 | -------------------------------------------------------------------------------- /server/Logging.Server.Site/alerting/SetAppErrOpts.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="C#" CodeBehind="SetAppErrOpts.ashx.cs" Class="Logging.Server.Site.alerting.SetAppErrOpts" %> 2 | -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/Thrift/Transport/TTransport.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/client/dotnetcore/Logging.Client/Thrift/Transport/TTransport.cs -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/Widgets/IWidget.cs: -------------------------------------------------------------------------------- 1 | namespace Logging.Client.Widgets 2 | { 3 | internal interface IWidget 4 | { 5 | // void Register 6 | } 7 | } -------------------------------------------------------------------------------- /client/go/loggingclient/LogLevel.go: -------------------------------------------------------------------------------- 1 | package loggingclient 2 | 3 | type LogLevel int 4 | 5 | const ( 6 | No LogLevel = iota 7 | Debug 8 | Info 9 | Warm 10 | Error 11 | ) 12 | -------------------------------------------------------------------------------- /client/java/logging.client/src/main/java/logging/client/ITimerActionBlock.java: -------------------------------------------------------------------------------- 1 | package logging.client; 2 | 3 | public interface ITimerActionBlock { 4 | void Enqueue(T item); 5 | } 6 | -------------------------------------------------------------------------------- /contract/Logging.ThriftContract/bin/Debug/Logging.ThriftContract.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/contract/Logging.ThriftContract/bin/Debug/Logging.ThriftContract.dll -------------------------------------------------------------------------------- /contract/Logging.ThriftContract/bin/Debug/Logging.ThriftContract.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/contract/Logging.ThriftContract/bin/Debug/Logging.ThriftContract.pdb -------------------------------------------------------------------------------- /contract/Logging.ThriftContract/obj/Debug/Logging.ThriftContract.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/contract/Logging.ThriftContract/obj/Debug/Logging.ThriftContract.dll -------------------------------------------------------------------------------- /contract/Logging.ThriftContract/obj/Debug/Logging.ThriftContract.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/contract/Logging.ThriftContract/obj/Debug/Logging.ThriftContract.pdb -------------------------------------------------------------------------------- /client/go/loggingclient/LogSenderManager.go: -------------------------------------------------------------------------------- 1 | package loggingclient 2 | 3 | func getLogSender() ILogSender { 4 | 5 | var iLogSender ILogSender = NewTHttpLogSender() 6 | return iLogSender 7 | } 8 | -------------------------------------------------------------------------------- /.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /contract/Thrift/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/contract/Thrift/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /contract/Thrift/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/contract/Thrift/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/bin/Debug/netstandard1.6/Logging.Client.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/client/dotnetcore/Logging.Client/bin/Debug/netstandard1.6/Logging.Client.dll -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/bin/Debug/netstandard1.6/Logging.Client.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/client/dotnetcore/Logging.Client/bin/Debug/netstandard1.6/Logging.Client.pdb -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/bin/Release/netstandard1.6/Logging.Client.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/client/dotnetcore/Logging.Client/bin/Release/netstandard1.6/Logging.Client.dll -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/bin/Release/netstandard1.6/Logging.Client.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/client/dotnetcore/Logging.Client/bin/Release/netstandard1.6/Logging.Client.pdb -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/jQuery/css/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Web/Content/jQuery/css/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/jQuery/css/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Web/Content/jQuery/css/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/jQuery/css/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Web/Content/jQuery/css/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/jQuery/css/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Web/Content/jQuery/css/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/jQuery/css/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Web/Content/jQuery/css/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /server/Logging.Server.Site/Content/jQuery/css/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Site/Content/jQuery/css/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /server/Logging.Server.Site/Content/jQuery/css/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Site/Content/jQuery/css/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /server/Logging.Server.Site/Content/jQuery/css/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Site/Content/jQuery/css/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /server/Logging.Server.Site/Content/jQuery/css/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Site/Content/jQuery/css/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /server/Logging.Server.Site/Content/jQuery/css/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Site/Content/jQuery/css/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /client/go/loggingclient/LogOnOff.go: -------------------------------------------------------------------------------- 1 | package loggingclient 2 | 3 | //日志开关 4 | type LogOnOff struct { 5 | AppId int 6 | 7 | Debug byte 8 | 9 | Info byte 10 | 11 | Warm byte 12 | 13 | Error byte 14 | } 15 | -------------------------------------------------------------------------------- /server/Logging.Server.Site/Content/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Site/Content/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /server/Logging.Server.Site/Content/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Site/Content/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /server/Logging.Server.Site/Content/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Site/Content/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /server/Logging.Server.Site/Content/jQuery/css/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Site/Content/jQuery/css/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /server/Logging.Server.Site/Content/jQuery/css/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Site/Content/jQuery/css/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /server/Logging.Server.Site/Content/jQuery/css/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Site/Content/jQuery/css/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /server/Logging.Server.Site/Content/jQuery/css/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Site/Content/jQuery/css/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /server/Logging.Server.Site/Content/jQuery/css/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Site/Content/jQuery/css/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /server/Logging.Server.Site/Content/jQuery/css/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Site/Content/jQuery/css/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /server/Logging.Server.Site/Content/jQuery/css/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Site/Content/jQuery/css/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Web/Content/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Web/Content/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Web/Content/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Web/Content/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/jQuery/css/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Web/Content/jQuery/css/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/jQuery/css/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Web/Content/jQuery/css/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/jQuery/css/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Web/Content/jQuery/css/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/jQuery/css/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Web/Content/jQuery/css/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/jQuery/css/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Web/Content/jQuery/css/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/jQuery/css/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Web/Content/jQuery/css/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/jQuery/css/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Web/Content/jQuery/css/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /client/csharp/Logging.Client/LogLevel.cs: -------------------------------------------------------------------------------- 1 | namespace Logging.Client 2 | { 3 | public enum LogLevel 4 | { 5 | Debug = 1, 6 | Info = 2, 7 | Warn = 3, 8 | Error = 4 9 | } 10 | } -------------------------------------------------------------------------------- /client/csharp/Logging.Client/Logger/ITimerActionBlock.cs: -------------------------------------------------------------------------------- 1 | namespace Logging.Client 2 | { 3 | internal interface ITimerActionBlock 4 | { 5 | void Enqueue(T item); 6 | 7 | void Flush(); 8 | } 9 | } -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/LogLevel.cs: -------------------------------------------------------------------------------- 1 | namespace Logging.Client 2 | { 3 | public enum LogLevel 4 | { 5 | Debug = 1, 6 | Info = 2, 7 | Warm = 3, 8 | Error = 4 9 | } 10 | } -------------------------------------------------------------------------------- /server/Logging.Server.Site/Content/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Site/Content/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /server/Logging.Server/Entitys/LogLevel.cs: -------------------------------------------------------------------------------- 1 | namespace Logging.Server 2 | { 3 | public enum LogLevel 4 | { 5 | Debug = 1, 6 | Info = 2, 7 | Warn = 3, 8 | Error = 4 9 | } 10 | } -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/Logger/ITimerActionBlock.cs: -------------------------------------------------------------------------------- 1 | namespace Logging.Client 2 | { 3 | internal interface ITimerActionBlock 4 | { 5 | void Enqueue(T item); 6 | 7 | void Flush(); 8 | } 9 | } -------------------------------------------------------------------------------- /contract/Logging.ThriftContract/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/contract/Logging.ThriftContract/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /client/java/logging.client/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /contract/Logging.ThriftContract/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/contract/Logging.ThriftContract/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /server/Logging.Server.Site/Content/jQuery/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Site/Content/jQuery/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/jQuery/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/server/Logging.Server.Web/Content/jQuery/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /client/java/logging.client/src/main/java/logging/client/ILogEntity.java: -------------------------------------------------------------------------------- 1 | package logging.client; 2 | 3 | public abstract class ILogEntity { 4 | /// 5 | /// 类型:1Log;2:Metric 6 | /// 7 | public int Type; 8 | } 9 | -------------------------------------------------------------------------------- /contract/Logging.ThriftContract/obj/Debug/Logging.ThriftContract.csprojResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xumingxiang/Logging/HEAD/contract/Logging.ThriftContract/obj/Debug/Logging.ThriftContract.csprojResolveAssemblyReference.cache -------------------------------------------------------------------------------- /server/Logging.Server.Site/Reciver.ashx.cs: -------------------------------------------------------------------------------- 1 | using Logging.Server.Reciver; 2 | 3 | namespace Logging.Server.Site 4 | { 5 | /// 6 | /// Recive 的摘要说明 7 | /// 8 | public class Reciver : HttpReciver 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /server/Logging.Server.Web/Reciver.ashx.cs: -------------------------------------------------------------------------------- 1 | using Logging.Server.Reciver; 2 | 3 | namespace Logging.Server.Site 4 | { 5 | /// 6 | /// Recive 的摘要说明 7 | /// 8 | public class Reciver : HttpReciver 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /client/csharp/Logging.Client/Logger/SimpleLogger.cs: -------------------------------------------------------------------------------- 1 | namespace Logging.Client 2 | { 3 | internal class SimpleLogger : BaseLogger, ILog 4 | { 5 | public SimpleLogger(string source) 6 | : base(source) 7 | { 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /contract/Thrift/Thrift.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ProjectFiles 5 | 6 | -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/Logger/SimpleLogger.cs: -------------------------------------------------------------------------------- 1 | namespace Logging.Client 2 | { 3 | internal class SimpleLogger : BaseLogger, ILog 4 | { 5 | public SimpleLogger(string source) 6 | : base(source) 7 | { 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /server/Logging.Server/Logging.Server.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ProjectFiles 5 | 6 | -------------------------------------------------------------------------------- /server/Logging.Server.Site/Index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Hello I am server 10 | 11 | 12 | -------------------------------------------------------------------------------- /client/csharp/Logging.Client/Logging.Client.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ProjectFiles 5 | 6 | -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/LogSender/LogSenderResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Logging.Client 4 | { 5 | internal class LogSenderResult 6 | { 7 | public bool Success { get; set; } 8 | 9 | public Exception Exception { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/Logging.Client.xproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 启动 5 | 6 | -------------------------------------------------------------------------------- /client/csharp/Logging.Client/Tags.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Logging.Client 8 | { 9 | public class Tags : Dictionary 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /server/Logging.Server/Alerting/AlertingType.cs: -------------------------------------------------------------------------------- 1 | namespace Logging.Server.Alerting 2 | { 3 | /// 4 | /// 提醒类型 5 | /// 6 | public enum AlertingType 7 | { 8 | /// 9 | /// 10 | /// 11 | AppError = 1 12 | } 13 | } -------------------------------------------------------------------------------- /client/java/logging.client.test/.idea/libraries/logging_client.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /client/java/logging.client/src/main/java/logging/client/SimpleLogger.java: -------------------------------------------------------------------------------- 1 | package logging.client; 2 | 3 | public class SimpleLogger extends BaseLogger implements ILog { 4 | 5 | public SimpleLogger(String source) { 6 | super(source); 7 | // TODO Auto-generated constructor stub 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /client/java/logging.client/src/main/java/logging/client/LogOnOff.java: -------------------------------------------------------------------------------- 1 | package logging.client; 2 | 3 | public class LogOnOff { 4 | 5 | public int AppId ; 6 | 7 | public byte Debug ; 8 | 9 | public byte Info ; 10 | 11 | public byte Warm ; 12 | 13 | public byte Error ; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /server/Logging.Server.Web/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @ViewData["Title"] - Logging.Server.Web 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /client/csharp/Logging.Client/Widgets/IWidget.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Logging.Client.Widgets 8 | { 9 | interface IWidget 10 | { 11 | // void Register 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /server/Logging.Server.Web/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @ViewData["Title"] - Logging.Server.Web 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /server/Logging.Server.Web/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | 3 | namespace Logging.Server.Web 4 | { 5 | public class HomeController : Controller 6 | { 7 | public ActionResult Index() 8 | { 9 | return Content("this is logging server !"); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /server/Logging.Server/LogProcessor/ILogProcessor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Logging.Server.Processor 4 | { 5 | /// 6 | /// 处理队列元素(日志)的处理器 7 | /// 8 | internal interface ILogProcessor 9 | { 10 | void Process(IList logs); 11 | } 12 | } -------------------------------------------------------------------------------- /client/java/logging.client.test/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /client/java/logging.client/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /server/Logging.Server/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /server/Logging.Server.Web/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | 3 | namespace Logging.Server.Web 4 | { 5 | public class FilterConfig 6 | { 7 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 8 | { 9 | filters.Add(new HandleErrorAttribute()); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /server/Logging.Server/Metric/MetricProcessor/IMetricProcessor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Logging.Server.Metric.Processor 4 | { 5 | /// 6 | /// 处理队列元素(日志)的处理器 7 | /// 8 | public interface IMetricProcessor 9 | { 10 | void Process(IList logs); 11 | } 12 | } -------------------------------------------------------------------------------- /client/java/logging.client.test/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /client/java/logging.client/src/main/java/logging/client/MetricEntity.java: -------------------------------------------------------------------------------- 1 | package logging.client; 2 | 3 | import java.util.Map; 4 | 5 | public class MetricEntity extends ILogEntity { 6 | 7 | public String Name; 8 | 9 | public double Value; 10 | 11 | public long Time; 12 | 13 | public Map Tags; 14 | } 15 | -------------------------------------------------------------------------------- /server/Logging.Server/Entitys/LogTag.cs: -------------------------------------------------------------------------------- 1 | using MongoDB.Bson; 2 | 3 | namespace Logging.Server 4 | { 5 | public class LogTag 6 | { 7 | public ObjectId _id { get; set; } 8 | 9 | public ObjectId LogId { get; set; } 10 | 11 | public long Tag { get; set; } 12 | 13 | public long Time { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /server/Logging.Server.Web/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Optimization; 2 | 3 | namespace Logging.Server.Web 4 | { 5 | public class BundleConfig 6 | { 7 | // 有关绑定的详细信息,请访问 http://go.microsoft.com/fwlink/?LinkId=301862 8 | public static void RegisterBundles(BundleCollection bundles) 9 | { 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /server/Logging.Server/Entitys/Options.cs: -------------------------------------------------------------------------------- 1 | using MongoDB.Bson; 2 | 3 | namespace Logging.Server 4 | { 5 | public class Options 6 | { 7 | public ObjectId _id { get; set; } 8 | 9 | public string Key { get; set; } 10 | 11 | public string Value { get; set; } 12 | 13 | public long UpdateTime { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /server/Logging.Server/LogReciver/HttpReciver.cs: -------------------------------------------------------------------------------- 1 | using Logging.ThriftContract; 2 | using Thrift.Transport; 3 | 4 | namespace Logging.Server.Reciver 5 | { 6 | public class HttpReciver : THttpHandler 7 | { 8 | public HttpReciver() 9 | : base(new LogTransferService.Processor(new LogReciverBase())) 10 | { 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /client/go/loggingclient/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Launch", 6 | "type": "go", 7 | "request": "launch", 8 | "mode": "debug", 9 | "remotePath": "", 10 | "port": 2345, 11 | "host": "127.0.0.1", 12 | "program": "${workspaceRoot}", 13 | "env": {}, 14 | "args": [] 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /server/Logging.Server/LogProcessor/LogProcessorManager.cs: -------------------------------------------------------------------------------- 1 | namespace Logging.Server.Processor 2 | { 3 | internal sealed class LogProcessorManager 4 | { 5 | private LogProcessorManager() 6 | { } 7 | 8 | public static ILogProcessor GetLogProcessor() 9 | { 10 | return new DefaultLogProcessor(); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/LogSender/LogSenderManager.cs: -------------------------------------------------------------------------------- 1 | namespace Logging.Client.LogSender 2 | { 3 | internal sealed class LogSenderManager 4 | { 5 | private LogSenderManager() 6 | { 7 | } 8 | 9 | public static LogSenderBase GetLogSender() 10 | { 11 | return new THttpLogSender(); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /client/java/logging.client/src/main/java/org/apache/thrift/slf/LoggerFactory.java: -------------------------------------------------------------------------------- 1 | package org.apache.thrift.slf; 2 | 3 | public class LoggerFactory { 4 | public static Logger getLogger(String logName){ 5 | 6 | return new Logger(); 7 | 8 | } 9 | 10 | public static Logger getLogger(Class type){ 11 | 12 | return getLogger(type.getName()); 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /server/Logging.Server.Site/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace Logging.Server.Site 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /server/Logging.Server.Web/Controllers/LogVM.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Logging.Server.Web 4 | { 5 | public class LogVM 6 | { 7 | public long Start { get; set; } 8 | 9 | public long End { get; set; } 10 | 11 | public long Cursor { get; set; } 12 | 13 | public List List { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /server/Logging.Server.Web/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Owin; 2 | using Owin; 3 | 4 | [assembly: OwinStartupAttribute(typeof(Logging.Server.Web.Startup))] 5 | 6 | namespace Logging.Server.Web 7 | { 8 | public partial class Startup 9 | { 10 | public void Configuration(IAppBuilder app) 11 | { 12 | // ConfigureAuth(app); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /server/Logging.Server/Alerting/AlertingHistory.cs: -------------------------------------------------------------------------------- 1 | using MongoDB.Bson; 2 | 3 | namespace Logging.Server.Alerting 4 | { 5 | public class AlertingHistory 6 | { 7 | public ObjectId _id { get; set; } 8 | 9 | public int ObjId { get; set; } 10 | 11 | public AlertingType AlertingType { get; set; } 12 | 13 | public long Time { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /server/Logging.Server/Entitys/MetricEntity.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Logging.Server 4 | { 5 | public class MetricEntity 6 | { 7 | public string Name { get; set; } 8 | 9 | public double Value { get; set; } 10 | 11 | public long Time { get; set; } 12 | 13 | public Dictionary Tags { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /client/csharp/Logging.Client/LogSender/LogSenderResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Logging.Client 8 | { 9 | class LogSenderResult 10 | { 11 | 12 | public bool Success { get; set; } 13 | 14 | public Exception Exception { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /client/go/loggingclient/loggingclient.config.template: -------------------------------------------------------------------------------- 1 | { 2 | //应用号 3 | "AppId" :6001, 4 | 5 | //是否启用日志 6 | "LoggingEnabled" :true, 7 | 8 | //设置日志服务器 9 | "LoggingServerHost":"", 10 | 11 | //队列最大长度 12 | "QueueMaxLength":50000, 13 | 14 | /// 元素包的大小 15 | "BufferSize":300, 16 | 17 | //队列阻塞时间。单位:秒 18 | "BlockElapsed":5 , 19 | 20 | //开关缓存时间。单位:分钟 21 | "LogOnOffCacheTimeOut":5 22 | } -------------------------------------------------------------------------------- /server/Logging.Server/Metric/MetricProcessor/MetricProcessorManager.cs: -------------------------------------------------------------------------------- 1 | namespace Logging.Server.Metric.Processor 2 | { 3 | public sealed class MetricProcessorManager 4 | { 5 | private MetricProcessorManager() 6 | { } 7 | 8 | public static IMetricProcessor GetMetricProcessor() 9 | { 10 | return new DefaulMetricProcessor(); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /server/Logging.Server/Alerting/BaseAlerting.cs: -------------------------------------------------------------------------------- 1 | namespace Logging.Server.Alerting 2 | { 3 | public abstract class BaseAlerting 4 | { 5 | public BaseAlerting(AlertingType alertingType) 6 | { 7 | this.AlertingType = alertingType; 8 | } 9 | 10 | public abstract void Alert(); 11 | 12 | protected AlertingType AlertingType { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /client/java/logging.client/.idea/artifacts/logging_client_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/out/artifacts/logging_client_jar 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/LogOnOff.cs: -------------------------------------------------------------------------------- 1 | namespace Logging.Client 2 | { 3 | /// 4 | /// 日志开关 5 | /// 6 | public class LogOnOff 7 | { 8 | public int AppId { get; set; } 9 | 10 | public byte Debug { get; set; } 11 | 12 | public byte Info { get; set; } 13 | 14 | public byte Warm { get; set; } 15 | 16 | public byte Error { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /client/java/logging.client.test/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.8 8 | -------------------------------------------------------------------------------- /server/Logging.Server/LogWriter/ILogWriter.cs: -------------------------------------------------------------------------------- 1 | using Logging.Server.Alerting; 2 | using System.Collections.Generic; 3 | 4 | namespace Logging.Server.Writer 5 | { 6 | public interface ILogWriter 7 | { 8 | void Write(IList logs); 9 | 10 | void SetLogOnOff(LogOnOff on_off); 11 | 12 | void SetOptions(List opts); 13 | 14 | void RecordAlerting(AlertingHistory ah); 15 | } 16 | } -------------------------------------------------------------------------------- /client/java/logging.client.test/.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/obj/Debug/netstandard1.6/dotnet-compile.assemblyinfo.cs: -------------------------------------------------------------------------------- 1 | // This file has been auto generated. 2 | [assembly:System.Reflection.AssemblyFileVersionAttribute("1.0.1.0")] 3 | [assembly:System.Reflection.AssemblyVersionAttribute("1.0.1.0")] 4 | [assembly:System.Reflection.AssemblyInformationalVersionAttribute("1.0.1")] 5 | [assembly:System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v1.6")] -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/obj/Release/netstandard1.6/dotnet-compile.assemblyinfo.cs: -------------------------------------------------------------------------------- 1 | // This file has been auto generated. 2 | [assembly:System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 3 | [assembly:System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 4 | [assembly:System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 5 | [assembly:System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v1.6")] -------------------------------------------------------------------------------- /client/go/loggingclient/constants.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.9.2) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package loggingclient 5 | 6 | import ( 7 | "bytes" 8 | "fmt" 9 | "git.corp.plu.cn/plugo/infrastructure/loggingclient/thrift" 10 | ) 11 | 12 | // (needed to ensure safety because of naive import list construction.) 13 | var _ = thrift.ZERO 14 | var _ = fmt.Printf 15 | var _ = bytes.Equal 16 | 17 | func init() { 18 | } 19 | -------------------------------------------------------------------------------- /client/java/logging.client/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /client/csharp/Logging.Client/LogSender/LogSenderManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Logging.Client.LogSender 8 | { 9 | internal sealed class LogSenderManager 10 | { 11 | private LogSenderManager() { } 12 | 13 | public static LogSenderBase GetLogSender() 14 | { 15 | return new THttpLogSender(); 16 | } 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /client/go/loggingclient/MetricEntity.go: -------------------------------------------------------------------------------- 1 | package loggingclient 2 | 3 | type MetricEntity struct { 4 | Type int 5 | 6 | Name string 7 | 8 | Value float64 9 | 10 | Time int64 11 | 12 | Tags map[string]string 13 | } 14 | 15 | func (this *MetricEntity) getType() int { 16 | return 2 17 | } 18 | 19 | // NewMetricEntity 实例化一个MetricEntity引用对象 20 | func NewMetricEntity() *MetricEntity { 21 | 22 | var metricEntity = new(MetricEntity) 23 | metricEntity.Type = 2 24 | return metricEntity 25 | } 26 | -------------------------------------------------------------------------------- /client/java/logging.client/src/main/main.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /server/Logging.Server.Site/metrics/test.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="Logging.Server.Site.metrics.test" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 | 14 |
15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /client/java/logging.client/src/main/java/logging/client/LogEntity.java: -------------------------------------------------------------------------------- 1 | package logging.client; 2 | 3 | import java.util.Map; 4 | 5 | public class LogEntity extends ILogEntity { 6 | 7 | // public LogEntity() {Type = 1; } 8 | 9 | public String Title; 10 | 11 | public String Message; 12 | 13 | public int Level; 14 | 15 | public long Time; 16 | 17 | public String Source; 18 | 19 | public int Thread; 20 | 21 | public Map Tags; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /server/Logging.Server/LogProcessor/DefaultLogProcessor.cs: -------------------------------------------------------------------------------- 1 | using Logging.Server.Writer; 2 | using System.Collections.Generic; 3 | 4 | namespace Logging.Server.Processor 5 | { 6 | /// 7 | /// 处理队列元素(日志)的处理器 8 | /// 9 | internal class DefaultLogProcessor : ILogProcessor 10 | { 11 | public void Process(IList logs) 12 | { 13 | var logWriter = LogWriterManager.GetLogWriter(); 14 | 15 | logWriter.Write(logs); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /client/csharp/Logging.Client/LogOnOff.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace Logging.Client 6 | { 7 | /// 8 | /// 日志开关 9 | /// 10 | public class LogOnOff 11 | { 12 | 13 | public int AppId { get; set; } 14 | 15 | public byte Debug { get; set; } 16 | 17 | public byte Info { get; set; } 18 | 19 | public byte Warn { get; set; } 20 | 21 | public byte Error { get; set; } 22 | 23 | 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /server/Logging.Server.Site/App_Start/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http.Formatting; 2 | using System.Web.Http; 3 | 4 | namespace Logging.Server.Site 5 | { 6 | public static class WebApiConfig 7 | { 8 | public static void Register(HttpConfiguration config) 9 | { 10 | // Web API 配置和服务 11 | 12 | config.Formatters.Clear(); 13 | config.Formatters.Add(new JsonMediaTypeFormatter()); 14 | 15 | // Web API 路由 16 | config.MapHttpAttributeRoutes(); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /server/Logging.Server/Entitys/LogStatistics.cs: -------------------------------------------------------------------------------- 1 | using MongoDB.Bson; 2 | 3 | namespace Logging.Server 4 | { 5 | public class LogStatistics 6 | { 7 | public ObjectId _id { get; set; } 8 | 9 | public int AppId { get; set; } 10 | 11 | public string AppName { get; set; } 12 | 13 | public int Debug { get; set; } 14 | 15 | public int Info { get; set; } 16 | 17 | public int Warn { get; set; } 18 | 19 | public int Error { get; set; } 20 | 21 | public long Time { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /server/Logging.Server/Entitys/LogOnOff.cs: -------------------------------------------------------------------------------- 1 | using MongoDB.Bson; 2 | 3 | namespace Logging.Server 4 | { 5 | /// 6 | /// 日志开关 7 | /// 8 | public class LogOnOff 9 | { 10 | public ObjectId _id { get; set; } 11 | 12 | public int AppId { get; set; } 13 | 14 | public string AppName { get; set; } 15 | 16 | public byte Debug { get; set; } 17 | 18 | public byte Info { get; set; } 19 | 20 | public byte Warn { get; set; } 21 | 22 | public byte Error { get; set; } 23 | } 24 | } -------------------------------------------------------------------------------- /client/go/loggingclient/LogEntity.go: -------------------------------------------------------------------------------- 1 | package loggingclient 2 | 3 | type LogEntity struct { 4 | Type int 5 | 6 | Title string 7 | 8 | Message string 9 | 10 | Level int8 11 | 12 | Time int64 13 | 14 | Source string 15 | 16 | Thread int32 17 | 18 | Tags map[string]string 19 | } 20 | 21 | func NewLogEntity() *LogEntity { 22 | 23 | var logEntity = new(LogEntity) 24 | logEntity.Type = 1 25 | logEntity.Thread = 0 //Thread.CurrentThread.ManagedThreadId 26 | return logEntity 27 | } 28 | 29 | func (this *LogEntity) getType() int { 30 | return 1 31 | } 32 | -------------------------------------------------------------------------------- /server/Logging.Server.Web/Content/bootstrap/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /server/Logging.Server.Site/Content/bootstrap/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /client/go/loggingclient/ILog.go: -------------------------------------------------------------------------------- 1 | package loggingclient 2 | 3 | // ILog loggingclient对外提供的接口 4 | type ILog interface { 5 | Debug(params ...interface{}) 6 | 7 | Info(params ...interface{}) 8 | 9 | Warm(params ...interface{}) 10 | 11 | Error(params ...interface{}) 12 | 13 | Debugf(format string, params ...interface{}) 14 | 15 | Infof(format string, params ...interface{}) 16 | 17 | Warmf(format string, params ...interface{}) 18 | 19 | Errorf(format string, params ...interface{}) 20 | 21 | Metric(name string, value float64, tags map[string]string) 22 | 23 | Flush() 24 | } 25 | -------------------------------------------------------------------------------- /contract/Thrift/obj/Debug/Thrift.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | D:\WorkStudio\Logging\Thrift\bin\Debug\Thrift.dll 2 | D:\WorkStudio\Logging\Thrift\bin\Debug\Thrift.pdb 3 | D:\WorkStudio\Logging\Thrift\obj\Debug\Thrift.dll 4 | D:\WorkStudio\Logging\Thrift\obj\Debug\Thrift.pdb 5 | D:\workstudio\Logging\contract\Thrift\bin\Debug\Thrift.dll 6 | D:\workstudio\Logging\contract\Thrift\bin\Debug\Thrift.pdb 7 | D:\workstudio\Logging\contract\Thrift\obj\Debug\Thrift.dll 8 | D:\workstudio\Logging\contract\Thrift\obj\Debug\Thrift.pdb 9 | D:\workstudio\Logging\contract\Thrift\obj\Debug\Thrift.csprojResolveAssemblyReference.cache 10 | -------------------------------------------------------------------------------- /server/Logging.Server.Web/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using System.Web.Routing; 3 | 4 | namespace Logging.Server.Web 5 | { 6 | public class RouteConfig 7 | { 8 | public static void RegisterRoutes(RouteCollection routes) 9 | { 10 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 11 | 12 | routes.MapRoute( 13 | name: "Default", 14 | url: "{controller}/{action}/{id}", 15 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 16 | ); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.1-*", 3 | 4 | "dependencies": { 5 | "Microsoft.AspNetCore.Http.Abstractions": "1.0.0", 6 | "NETStandard.Library": "1.6.0", 7 | "System.Collections.Specialized": "4.0.1", 8 | "System.IO.Pipes": "4.0.0", 9 | "System.Net.NameResolution": "4.0.0", 10 | "System.Net.Requests": "4.0.11", 11 | "System.Net.Security": "4.0.0", 12 | "System.Threading.Thread": "4.0.0", 13 | "System.Threading.ThreadPool": "4.0.10" 14 | }, 15 | 16 | "frameworks": { 17 | "netstandard1.6": { 18 | "imports": "dnxcore50" 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /server/Logging.Server.Web/App_Start/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Http; 2 | 3 | namespace Logging.Server.Web 4 | { 5 | public static class WebApiConfig 6 | { 7 | public static void Register(HttpConfiguration config) 8 | { 9 | // Web API 配置和服务 10 | 11 | // Web API 路由 12 | config.MapHttpAttributeRoutes(); 13 | 14 | config.Routes.MapHttpRoute( 15 | name: "DefaultApi", 16 | routeTemplate: "api/{controller}/{id}", 17 | defaults: new { id = RouteParameter.Optional } 18 | ); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /server/Logging.Server.Site/Test/MetricTest.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MetricTest.aspx.cs" Inherits="Logging.Server.Site.Test.MetricTest" Async="true" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 | 14 | 15 | 16 |
17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /Logging.Client/obj 2 | /Logging.Client/bin 3 | /Logging.Client.TestSite/obj 4 | /Logging.Client.TestSite/bin 5 | /Logging.Server/obj 6 | /Logging.Server/bin 7 | /Logging.Server.Site/obj 8 | /Logging.Server.Site/bin 9 | /Logging.Test/obj 10 | /Logging.ThriftContract/obj 11 | /Thrift/obj 12 | *.suo 13 | /packages 14 | /server/Logging.Server.Site/obj 15 | /server/Logging.Server.Site/bin 16 | /server/Logging.Server/obj 17 | /server/Logging.Server/bin 18 | /client/csharp/Logging.Client.TestSite/Bin 19 | /client/csharp/Logging.Client.TestSite/obj 20 | /client/csharp/Logging.Client/obj 21 | /client/csharp/Logging.Client/bin 22 | obj 23 | bin 24 | -------------------------------------------------------------------------------- /server/Logging.Server/Entitys/OptionKeys.cs: -------------------------------------------------------------------------------- 1 | namespace Logging.Server.Entitys 2 | { 3 | public enum OptionKeys 4 | { 5 | /// 6 | /// 错误数量报警线 7 | /// 8 | ALERTING_APPERROR_ERRORCOUNTLIMIT, 9 | 10 | /// 11 | /// 错误增长速度报警线(环比) 12 | /// 13 | ALERTING_APPERROR_ERRORGROWTHLIMIT, 14 | 15 | /// 16 | /// 报警间隔时间.单位:分钟 17 | /// 18 | ALERTING_APPERROR_INTERVAL, 19 | 20 | /// 21 | /// 异常报警邮件收件人 22 | /// 23 | ALERTING_APPERROR_EMAILRECEIVERS 24 | } 25 | } -------------------------------------------------------------------------------- /server/Logging.Server.Web/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Http; 2 | using System.Web.Mvc; 3 | using System.Web.Routing; 4 | 5 | namespace Logging.Server.Web 6 | { 7 | public class MvcApplication : System.Web.HttpApplication 8 | { 9 | protected void Application_Start() 10 | { 11 | AreaRegistration.RegisterAllAreas(); 12 | GlobalConfiguration.Configure(WebApiConfig.Register); 13 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 14 | RouteConfig.RegisterRoutes(RouteTable.Routes); 15 | // BundleConfig.RegisterBundles(BundleTable.Bundles); 16 | BackgroundTask.InitTasks(); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/System/Web/IHttpHandler.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | 3 | namespace System.Web 4 | { 5 | public interface IHttpHandler 6 | { 7 | /// 8 | /// 9 | /// Drives web processing execution. 10 | /// 11 | /// 12 | void ProcessRequest(HttpContext context); 13 | 14 | /// 15 | /// 16 | /// Allows an IHTTPHandler instance to indicate at the end of a 17 | /// request whether it can be recycled and used for another request. 18 | /// 19 | /// 20 | bool IsReusable { get; } 21 | } 22 | } -------------------------------------------------------------------------------- /client/java/logging.client/src/main/java/org/apache/thrift/server/Invocation.java: -------------------------------------------------------------------------------- 1 | package org.apache.thrift.server; 2 | 3 | import org.apache.thrift.server.AbstractNonblockingServer.FrameBuffer; 4 | 5 | /** 6 | * An Invocation represents a method call that is prepared to execute, given 7 | * an idle worker thread. It contains the input and output protocols the 8 | * thread's processor should use to perform the usual Thrift invocation. 9 | */ 10 | class Invocation implements Runnable { 11 | private final FrameBuffer frameBuffer; 12 | 13 | public Invocation(final FrameBuffer frameBuffer) { 14 | this.frameBuffer = frameBuffer; 15 | } 16 | 17 | public void run() { 18 | frameBuffer.invoke(); 19 | } 20 | } -------------------------------------------------------------------------------- /client/csharp/Logging.Client.TestSite/Default.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Logging.Client.TestSite.Default" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 | Hello I am Client 14 |
15 | <%-- --%> 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /client/java/logging.client/src/main/java/logging/client/App.java: -------------------------------------------------------------------------------- 1 | package logging.client; 2 | 3 | public class App { 4 | 5 | public static void main(String[] args) throws Exception { 6 | // // TODO Auto-generated method stub 7 | // Settings.startup(4004, "http://183.131.23.176:9092/server", 300, 10 * 1000); 8 | // 9 | // ILog logger = LogManager.getLogger(App.class); 10 | // 11 | // logger.info("asdadadad"); 12 | // logger.info("asdadadad2"); 13 | // logger.metric("metric_java_test2", 1, null); 14 | // logger.metric("metric_java_test2", 1, null); 15 | // logger.info("asdadadad3"); 16 | // logger.flush(); 17 | // System.out.println("metric over"); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /server/Logging.Server.Site/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace Logging.Server.Site 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | 22 | 23 | 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /client/dotnetcore/Logging.Client/ConfigurationManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Collections.Specialized; 3 | 4 | namespace Logging.Client 5 | { 6 | public class ConfigurationManager 7 | { 8 | private static Dictionary _appSettings { get; set; } 9 | 10 | static ConfigurationManager() 11 | { 12 | // _appSettings = new Dictionary(); 13 | 14 | AppSettings = new NameValueCollection(); 15 | } 16 | 17 | public static NameValueCollection AppSettings { get; set; } 18 | 19 | //public static Dictionary 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 |
12 | 13 | 14 | 15 |
16 | 17 |
18 | 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 enumClass; 26 | 27 | public EnumMetaData(byte type, Class 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 structClass; 26 | 27 | public StructMetaData(byte type, Class 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 | } --------------------------------------------------------------------------------