diff --git a/BLWLogProduce/BLWLogProduce.csproj b/BLWLogProduce/BLWLogProduce.csproj index ee675b4..fe39e39 100644 --- a/BLWLogProduce/BLWLogProduce.csproj +++ b/BLWLogProduce/BLWLogProduce.csproj @@ -7,13 +7,12 @@ - - + - - - - + + + + diff --git a/BLWLogProduce/NLog.xsd b/BLWLogProduce/NLog.xsd index 43f470d..8871c5c 100644 --- a/BLWLogProduce/NLog.xsd +++ b/BLWLogProduce/NLog.xsd @@ -812,6 +812,7 @@ + @@ -835,7 +836,7 @@ - Text to be matched. You must specify either text or regex. + Text to be matched for Highlighting. @@ -843,6 +844,11 @@ Indicates whether to match whole words only. + + + List of words to be matched for Highlighting. + + @@ -1829,7 +1835,7 @@ - Whether to disable the delayed ACK timer, and avoid delay of 200 ms. Default = true. + Whether to disable the delayed ACK timer, and avoid delay of 200 ms. @@ -2411,7 +2417,7 @@ - Whether to disable the delayed ACK timer, and avoid delay of 200 ms. Default = true. + Whether to disable the delayed ACK timer, and avoid delay of 200 ms. @@ -2545,12 +2551,12 @@ - + @@ -2558,18 +2564,18 @@ - - - - + + - + + + - + @@ -2587,11 +2593,6 @@ Footer. - - - Indicates whether NewLine characters in the body should be replaced with tags. - - Priority used for sending mails. @@ -2612,6 +2613,11 @@ BCC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + Indicates whether NewLine characters in the body should be replaced with tags. + + Recipients' email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). @@ -2643,14 +2649,9 @@ - + - Provides a way of specifying the SSL and/or TLS encryption If P:NLog.MailKit.MailTarget.EnableSsl is true, then F:MailKit.Security.SecureSocketOptions.SslOnConnect will be used. - - - - - Get or set whether the client should use the REQUIRETLS extension if it is available. + Folder where applications save mail messages to be processed by the local SMTP server. @@ -2658,14 +2659,9 @@ Indicates the SMTP client timeout. - + - Folder where applications save mail messages to be processed by the local SMTP server. - - - - - SMTP Server to be used for sending. + Indicates whether SmtpClient should ignore invalid certificate. @@ -2673,9 +2669,9 @@ Port number that SMTP Server is listening on. - + - Indicates whether SSL (secure sockets layer) should be used when communicating with SMTP server. + Provides a way of specifying the SSL and/or TLS encryption If P:NLog.MailKit.MailTarget.EnableSsl is true, then F:MailKit.Security.SecureSocketOptions.SslOnConnect will be used. @@ -2683,6 +2679,11 @@ Password used to authenticate against SMTP server (used when SmtpAuthentication is set to "basic"). + + + Indicates whether SSL (secure sockets layer) should be used when communicating with SMTP server. + + Username used to connect to SMTP server (used when SmtpAuthentication is set to "basic"). @@ -2693,14 +2694,19 @@ SMTP Authentication mode. + + + SMTP Server to be used for sending. + + Indicates whether the default Settings from System.Net.MailSettings should be used. - + - Indicates whether SmtpClient should ignore invalid certificate. + Get or set whether the client should use the REQUIRETLS extension if it is available. @@ -2732,6 +2738,7 @@ + @@ -3087,7 +3094,7 @@ - Whether to disable the delayed ACK timer, and avoid delay of 200 ms. Default = true. + Whether to disable the delayed ACK timer, and avoid delay of 200 ms. @@ -3133,7 +3140,7 @@ - Indicates whether to perform layout calculation. + Indicates whether to render P:NLog.Targets.TargetWithLayout.Layout for LogEvent @@ -3576,6 +3583,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Password for the custom SSL certificate specified by P:NLog.Targets.NetworkTarget.SslCertificateFile + + + + + File path to custom SSL certificate for TCP Socket SSL connections + + + + + SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. + + + + + The number of seconds a TCP socket send-operation will block before timeout error. Default = 100 secs (0 = wait forever when network cable unplugged and tcp-buffer becomes full). + + + + + Action that should be taken if the message is larger than P:NLog.Targets.NetworkTarget.MaxMessageSize + + + + + Action that should be taken, when more connections than P:NLog.Targets.NetworkTarget.MaxConnections. + + + + + Action that should be taken, when more pending messages than P:NLog.Targets.NetworkTarget.MaxQueueSize. + + + + + Maximum simultaneous connections. Requires P:NLog.Targets.NetworkTarget.KeepConnection = false + + + + + Indicates whether to keep connection open whenever possible. + + + + + The number of seconds a connection will remain idle before the first keep-alive probe is sent + + + + + Size of the connection cache (number of connections which are kept alive). Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Network destination address. + + + + + Maximum queue size for a single connection. Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + + + + + Whether to disable the delayed ACK timer, and avoid delay of 200 ms. + + + + + Skip compression when protocol payload is below limit to reduce overhead in cpu-usage and additional headers + + + + + + + + + Type of compression for protocol payload. Useful for UDP where datagram max-size is 8192 bytes. + + + + + + Maximum message size in bytes. On limit breach then P:NLog.Targets.NetworkTarget.OnOverflow action is activated. + + + + + Encoding to be used. + + + + + End of line value if a newline is appended at the end of log message P:NLog.Targets.NetworkTarget.NewLine. + + + + + Indicates whether to append newline at the end of log message. + + + + + + + + + + + + + + + + + + Name of the attribute. + + + + + Layout used for rendering the attribute value. + + + + + Fallback value when result value is not available + + + + + Whether output should be encoded as Json-String-Property, or be treated as valid json. + + + + + Indicates whether to escape non-ascii characters + + + + + Whether empty attribute value should be included in the output. + + + + + Result value type, for conversion of layout rendering output + + + @@ -3700,7 +3906,7 @@ - Whether to disable the delayed ACK timer, and avoid delay of 200 ms. Default = true. + Whether to disable the delayed ACK timer, and avoid delay of 200 ms. @@ -4218,52 +4424,6 @@ - - - - - - - - - - - - - Name of the attribute. - - - - - Layout used for rendering the attribute value. - - - - - Fallback value when result value is not available - - - - - Whether output should be encoded as Json-String-Property, or be treated as valid json. - - - - - Indicates whether to escape non-ascii characters - - - - - Whether empty attribute value should be included in the output. - - - - - Result value type, for conversion of layout rendering output - - - @@ -4455,6 +4615,94 @@ + + + + + + + + + + + + + + + + + + + + + + + Indicates whether to include contents of the T:NLog.GlobalDiagnosticsContext dictionary. + + + + + Auto indent and create new lines + + + + + How far should the JSON serializer follow object references before backing off + + + + + Option to render the empty object value {} + + + + + Option to suppress the extra spaces in the output json. + + + + + Option to exclude null/empty properties from the log event (as JSON) + + + + + List of property names to exclude when P:NLog.Layouts.SplunkLayout.IncludeEventProperties is true + + + + + Option to include all properties from the log events + + + + + Whether to include the contents of the T:NLog.ScopeContext properties-dictionary. + + + + + Splunk Message Host-attribute + + + + + Splunk Message Index-attribute, that controls which event data is to be indexed. + + + + + Splunk Message Source-attribute. Example the name of the application. + + + + + Splunk Message SourceType-attribute. SourceType can be used hint for choosing Splunk Indexer + + + + + diff --git a/BLWLogProduce/Services/KafkaProduce.cs b/BLWLogProduce/Services/KafkaProduce.cs index 2f4317d..0a6b2e5 100644 --- a/BLWLogProduce/Services/KafkaProduce.cs +++ b/BLWLogProduce/Services/KafkaProduce.cs @@ -787,7 +787,9 @@ namespace BLWLogProduce.Services string TopicKey = KafkaKey.BLWLog4XuanZhu_RCU_Topic; string DetailKey = KafkaKey.UDPPackageDeviceStatus; + string logKey = KafkaKey.BLWLog_RCU_Topic; await p.ProduceAsync(TopicKey, new Message { Key = DetailKey, Value = data }); + await p.ProduceAsync(logKey, new Message { Key = DetailKey, Value = data }); } catch (Exception ex) { diff --git a/BLWLogServer/BLWLogServer.csproj b/BLWLogServer/BLWLogServer.csproj index 81d9da8..5f76f3b 100644 --- a/BLWLogServer/BLWLogServer.csproj +++ b/BLWLogServer/BLWLogServer.csproj @@ -11,12 +11,12 @@ - - - - - - + + + + + + diff --git a/BLWLogServer/BLWLogServer.csproj.user b/BLWLogServer/BLWLogServer.csproj.user index 639430f..4418a07 100644 --- a/BLWLogServer/BLWLogServer.csproj.user +++ b/BLWLogServer/BLWLogServer.csproj.user @@ -1,7 +1,7 @@  - E:\tian\BLS\BLWLogServer\BLWLogServer\Properties\PublishProfiles\FolderProfile.pubxml + E:\tian\chongxin\NewGit\Web_BLSKafka_Server_Prod\BLWLogServer\Properties\PublishProfiles\FolderProfile.pubxml ApiControllerEmptyScaffolder root/Common/Api diff --git a/BLWLogServer/Controllers/UDPPackageController.cs b/BLWLogServer/Controllers/UDPPackageController.cs index 3b17e9b..8538355 100644 --- a/BLWLogServer/Controllers/UDPPackageController.cs +++ b/BLWLogServer/Controllers/UDPPackageController.cs @@ -882,7 +882,7 @@ namespace BLWLogServer.Controllers var font = workbook.CreateFont(); font.FontName = "Arial"; font.FontHeightInPoints = 11; - font.Boldweight = (short)FontBoldWeight.Bold; + font.IsBold = true; font.Color = IndexedColors.White.Index; style.SetFont(font); diff --git a/BLWLogServer/NLog.xsd b/BLWLogServer/NLog.xsd index 43f470d..8871c5c 100644 --- a/BLWLogServer/NLog.xsd +++ b/BLWLogServer/NLog.xsd @@ -812,6 +812,7 @@ + @@ -835,7 +836,7 @@ - Text to be matched. You must specify either text or regex. + Text to be matched for Highlighting. @@ -843,6 +844,11 @@ Indicates whether to match whole words only. + + + List of words to be matched for Highlighting. + + @@ -1829,7 +1835,7 @@ - Whether to disable the delayed ACK timer, and avoid delay of 200 ms. Default = true. + Whether to disable the delayed ACK timer, and avoid delay of 200 ms. @@ -2411,7 +2417,7 @@ - Whether to disable the delayed ACK timer, and avoid delay of 200 ms. Default = true. + Whether to disable the delayed ACK timer, and avoid delay of 200 ms. @@ -2545,12 +2551,12 @@ - + @@ -2558,18 +2564,18 @@ - - - - + + - + + + - + @@ -2587,11 +2593,6 @@ Footer. - - - Indicates whether NewLine characters in the body should be replaced with tags. - - Priority used for sending mails. @@ -2612,6 +2613,11 @@ BCC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + Indicates whether NewLine characters in the body should be replaced with tags. + + Recipients' email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). @@ -2643,14 +2649,9 @@ - + - Provides a way of specifying the SSL and/or TLS encryption If P:NLog.MailKit.MailTarget.EnableSsl is true, then F:MailKit.Security.SecureSocketOptions.SslOnConnect will be used. - - - - - Get or set whether the client should use the REQUIRETLS extension if it is available. + Folder where applications save mail messages to be processed by the local SMTP server. @@ -2658,14 +2659,9 @@ Indicates the SMTP client timeout. - + - Folder where applications save mail messages to be processed by the local SMTP server. - - - - - SMTP Server to be used for sending. + Indicates whether SmtpClient should ignore invalid certificate. @@ -2673,9 +2669,9 @@ Port number that SMTP Server is listening on. - + - Indicates whether SSL (secure sockets layer) should be used when communicating with SMTP server. + Provides a way of specifying the SSL and/or TLS encryption If P:NLog.MailKit.MailTarget.EnableSsl is true, then F:MailKit.Security.SecureSocketOptions.SslOnConnect will be used. @@ -2683,6 +2679,11 @@ Password used to authenticate against SMTP server (used when SmtpAuthentication is set to "basic"). + + + Indicates whether SSL (secure sockets layer) should be used when communicating with SMTP server. + + Username used to connect to SMTP server (used when SmtpAuthentication is set to "basic"). @@ -2693,14 +2694,19 @@ SMTP Authentication mode. + + + SMTP Server to be used for sending. + + Indicates whether the default Settings from System.Net.MailSettings should be used. - + - Indicates whether SmtpClient should ignore invalid certificate. + Get or set whether the client should use the REQUIRETLS extension if it is available. @@ -2732,6 +2738,7 @@ + @@ -3087,7 +3094,7 @@ - Whether to disable the delayed ACK timer, and avoid delay of 200 ms. Default = true. + Whether to disable the delayed ACK timer, and avoid delay of 200 ms. @@ -3133,7 +3140,7 @@ - Indicates whether to perform layout calculation. + Indicates whether to render P:NLog.Targets.TargetWithLayout.Layout for LogEvent @@ -3576,6 +3583,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name of the target. + + + + + Password for the custom SSL certificate specified by P:NLog.Targets.NetworkTarget.SslCertificateFile + + + + + File path to custom SSL certificate for TCP Socket SSL connections + + + + + SSL/TLS protocols. Default no SSL/TLS is used. Currently only implemented for TCP. + + + + + The number of seconds a TCP socket send-operation will block before timeout error. Default = 100 secs (0 = wait forever when network cable unplugged and tcp-buffer becomes full). + + + + + Action that should be taken if the message is larger than P:NLog.Targets.NetworkTarget.MaxMessageSize + + + + + Action that should be taken, when more connections than P:NLog.Targets.NetworkTarget.MaxConnections. + + + + + Action that should be taken, when more pending messages than P:NLog.Targets.NetworkTarget.MaxQueueSize. + + + + + Maximum simultaneous connections. Requires P:NLog.Targets.NetworkTarget.KeepConnection = false + + + + + Indicates whether to keep connection open whenever possible. + + + + + The number of seconds a connection will remain idle before the first keep-alive probe is sent + + + + + Size of the connection cache (number of connections which are kept alive). Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + Network destination address. + + + + + Maximum queue size for a single connection. Requires P:NLog.Targets.NetworkTarget.KeepConnection = true + + + + + + + + + Whether to disable the delayed ACK timer, and avoid delay of 200 ms. + + + + + Skip compression when protocol payload is below limit to reduce overhead in cpu-usage and additional headers + + + + + + + + + Type of compression for protocol payload. Useful for UDP where datagram max-size is 8192 bytes. + + + + + + Maximum message size in bytes. On limit breach then P:NLog.Targets.NetworkTarget.OnOverflow action is activated. + + + + + Encoding to be used. + + + + + End of line value if a newline is appended at the end of log message P:NLog.Targets.NetworkTarget.NewLine. + + + + + Indicates whether to append newline at the end of log message. + + + + + + + + + + + + + + + + + + Name of the attribute. + + + + + Layout used for rendering the attribute value. + + + + + Fallback value when result value is not available + + + + + Whether output should be encoded as Json-String-Property, or be treated as valid json. + + + + + Indicates whether to escape non-ascii characters + + + + + Whether empty attribute value should be included in the output. + + + + + Result value type, for conversion of layout rendering output + + + @@ -3700,7 +3906,7 @@ - Whether to disable the delayed ACK timer, and avoid delay of 200 ms. Default = true. + Whether to disable the delayed ACK timer, and avoid delay of 200 ms. @@ -4218,52 +4424,6 @@ - - - - - - - - - - - - - Name of the attribute. - - - - - Layout used for rendering the attribute value. - - - - - Fallback value when result value is not available - - - - - Whether output should be encoded as Json-String-Property, or be treated as valid json. - - - - - Indicates whether to escape non-ascii characters - - - - - Whether empty attribute value should be included in the output. - - - - - Result value type, for conversion of layout rendering output - - - @@ -4455,6 +4615,94 @@ + + + + + + + + + + + + + + + + + + + + + + + Indicates whether to include contents of the T:NLog.GlobalDiagnosticsContext dictionary. + + + + + Auto indent and create new lines + + + + + How far should the JSON serializer follow object references before backing off + + + + + Option to render the empty object value {} + + + + + Option to suppress the extra spaces in the output json. + + + + + Option to exclude null/empty properties from the log event (as JSON) + + + + + List of property names to exclude when P:NLog.Layouts.SplunkLayout.IncludeEventProperties is true + + + + + Option to include all properties from the log events + + + + + Whether to include the contents of the T:NLog.ScopeContext properties-dictionary. + + + + + Splunk Message Host-attribute + + + + + Splunk Message Index-attribute, that controls which event data is to be indexed. + + + + + Splunk Message Source-attribute. Example the name of the application. + + + + + Splunk Message SourceType-attribute. SourceType can be used hint for choosing Splunk Indexer + + + + + diff --git a/BLWLogServer/Services/KafkaConsume.cs b/BLWLogServer/Services/KafkaConsume.cs index 95b4c13..ec53cef 100644 --- a/BLWLogServer/Services/KafkaConsume.cs +++ b/BLWLogServer/Services/KafkaConsume.cs @@ -6,6 +6,7 @@ using Confluent.Kafka; using MongoDB.Driver; using NLog; using System.Collections.Generic; +using BLWData.Entity; namespace BLWLogServer.Services { @@ -308,6 +309,27 @@ namespace BLWLogServer.Services us.ZhiJieData = UDPPPP.ZhiJieData; await collection.InsertOneAsync(us); } + else if (k.Equals(KafkaKey.UDPPackageDeviceStatus)) + { + DeviceActionChangeDataPush e = new DeviceActionChangeDataPush(); + e = DeviceActionChangeDataPush.Parser.ParseFrom(v); + + var collection = client.GetDatabase("udppackage").GetCollection("xuanzhudevicestatuschanges"); + XuanZhuRequest_db us = new XuanZhuRequest_db(); + us.code = e.Code.ToString(); + us.roomNumber = e.RoomNumber; + us.devicetype = e.Devicetype; + us.address = e.Address; + us.status = e.Status; + us.name = e.Name; + us.currentTemp = e.CurrentTemp; + us.settingTemp = e.SettingTemp; + us.fanSpeed = e.FanSpeed; + us.mode = e.Mode; + us.valve = e.Valve; + us.timestamp = e.Createtime; + await collection.InsertOneAsync(us); + } #region 新版协议记录 diff --git a/CommonEntity/CommonEntity.csproj b/CommonEntity/CommonEntity.csproj index c51d54e..635ce02 100644 --- a/CommonEntity/CommonEntity.csproj +++ b/CommonEntity/CommonEntity.csproj @@ -7,6 +7,7 @@ + diff --git a/BLWLogProduce/DeviceActionChangeDataPush.cs b/CommonEntity/DeviceActionChangeDataPush.cs similarity index 100% rename from BLWLogProduce/DeviceActionChangeDataPush.cs rename to CommonEntity/DeviceActionChangeDataPush.cs diff --git a/CommonEntity/XuanZhuRequest.cs b/CommonEntity/XuanZhuRequest.cs index 37d1955..fed3c43 100644 --- a/CommonEntity/XuanZhuRequest.cs +++ b/CommonEntity/XuanZhuRequest.cs @@ -1,4 +1,5 @@ -using System; +using MongoDB.Bson; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -62,4 +63,10 @@ namespace CommonEntity /// public int valve { get; set; } } + + public class XuanZhuRequest_db : XuanZhuRequest + { + public ObjectId _id { get; set; } + public long timestamp { get; set; } + } } diff --git a/ConsoleApp2/ConsoleApp2.csproj b/ConsoleApp2/ConsoleApp2.csproj index 52fbffe..b780788 100644 --- a/ConsoleApp2/ConsoleApp2.csproj +++ b/ConsoleApp2/ConsoleApp2.csproj @@ -8,7 +8,6 @@ -