Xbgit.MqttRas 1.0.1

dotnet add package Xbgit.MqttRas --version 1.0.1
                    
NuGet\Install-Package Xbgit.MqttRas -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Xbgit.MqttRas" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Xbgit.MqttRas" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Xbgit.MqttRas" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Xbgit.MqttRas --version 1.0.1
                    
#r "nuget: Xbgit.MqttRas, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Xbgit.MqttRas@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Xbgit.MqttRas&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Xbgit.MqttRas&version=1.0.1
                    
Install as a Cake Tool

MqttRas - MQTT 网络日志工具

概述

MqttRas 是一个使用 MQTT 协议将关键日志发送到服务器的工具。它允许你通过 MQTT 发布日志消息,确保日志数据能够实时传输到指定的 MQTT 服务器。

主要功能

  • 使用 MQTT 发送关键日志到服务器。
  • 支持配置文件加载,方便自定义日志发送行为。
  • 处理发送失败的日志消息,确保日志不丢失。

安装

使用 NuGet 包管理器

bash dotnet add package Xbgit.MqttRas --version 1.0.1

使用 PackageReference

在你的 .csproj 文件中添加以下行:

<PackageReference Include="Xbgit.MqttRas" Version="1.0.1" />

使用示例

初始化和使用

csharp using MyLogger;
class Program 
{
    static void Main(string[] args) 
    {
        var logger = MqttRas.Instance; 
        logger.Ras("This is a test log message."); 
        logger.Ras("This is an error log message.", "An error occurred."); 
        logger.Ras("This is an exception log message.", new Exception("Exception details"));
    }
}

配置文件示例 (mqttLogger.json)

{ 
  "ServerAddress": "mqtt.example.com", 
  "Port": 1883, 
  "AppName": "MyApp",
  "AppVersion": "1.0.0", 
  "User": "user", 
  "Topic": "logs", 
  "Username": "username", 
  "Password": "password"
}

版本历史

1.0.1

  • 追加自述文件

1.0.0

  • 初始版本

许可证

本项目基于 自定义许可证

贡献

欢迎贡献代码和报告问题!请参考 贡献指南

联系方式

  • 作者: 张天宝
  • 公司: xbgit.cn
  • 邮箱: contact@xbgit.cn
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 194 4/15/2025
1.0.0 190 4/14/2025

1.0.1
           - 追加自述文件