This is an automated email from the ASF dual-hosted git repository. aaronai pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git
commit dc01d5e6e8b1b18c041de75753c7ce4630e4c687 Author: Aaron Ai <[email protected]> AuthorDate: Wed Mar 15 10:42:56 2023 +0800 Add the logging part of C# README.md --- csharp/README.md | 39 ++++++++++++++++++++++++++++++++------- java/README.md | 2 +- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/csharp/README.md b/csharp/README.md index 5e353855..df85a3fb 100644 --- a/csharp/README.md +++ b/csharp/README.md @@ -4,13 +4,16 @@ Here is the .NET implementation of the client for [Apache RocketMQ](https://rock ## Supported .NET Versions -Due to the release of .NET 5 in 2020, which unified .NET Framework and .NET Core, and has gradually become the mainstream platform for .NET development, the RocketMQ client will support .NET 5 and later versions. +Due to the release of .NET 5 in 2020, which unified .NET Framework and .NET Core, and has gradually become the +mainstream platform for .NET development, the RocketMQ client will support .NET 5 and later versions. See more details about .NET 5 from [Introducing .NET 5](https://devblogs.microsoft.com/dotnet/introducing-net-5/). ## Architecture -The client would be developed using the protocols outlined in [rocketmq-apis](https://github.com/apache/rocketmq-apis) and built on [gRPC-dotnet](https://github.com/grpc/grpc-dotnet), leveraging Protocol Buffers for data serialization and deserialization during transmission. +The client would be developed using the protocols outlined in [rocketmq-apis](https://github.com/apache/rocketmq-apis) +and built on [gRPC-dotnet](https://github.com/grpc/grpc-dotnet), leveraging Protocol Buffers for data serialization and +deserialization during transmission. ## Quickstart & Build @@ -18,9 +21,14 @@ The client would be developed using the protocols outlined in [rocketmq-apis](ht dotnet add package RocketMQ.Client ``` -You can obtain the latest version of `RocketMQ.Client` from [NuGet Gallery](https://www.nuget.org/packages/RocketMQ.Client). To assist with getting started quickly and working with various message types and clients, we offer examples [here](./examples). +You can obtain the latest version of `RocketMQ.Client` +from [NuGet Gallery](https://www.nuget.org/packages/RocketMQ.Client). To assist with getting started quickly and working +with various message types and clients, we offer examples [here](./examples). -Layout of this project roughly follows [this guide](https://docs.microsoft.com/en-us/dotnet/core/tutorials/library-with-visual-studio-code?pivots=dotnet-5-0). The solution contains a class library, a unit test module and an example console module. Assuming you are at the home of this repository: +Layout of this project roughly +follows [this guide](https://docs.microsoft.com/en-us/dotnet/core/tutorials/library-with-visual-studio-code?pivots=dotnet-5-0) +. The solution contains a class library, a unit test module and an example console module. Assuming you are at the home +of this repository: ```sh # build the project @@ -29,9 +37,26 @@ dotnet build dotnet test -l "console;verbosity=detailed" ``` +## Logging System + +We use [NLog](https://nlog-project.org/) as our logging implementation. Similar to the Java binding, we allow the use of +environment variables to customize the related configuration: + +* `rocketmq.log.level`: Log output level, default is INFO. +* `rocketmq.log.root`: The root directory of the log output. The default path is `$HOME/logs/rocketmq`, so the full path + is `$HOME/logs/rocketmq/rocketmq-client.log`. +* `rocketmq.log.file.maxIndex`: The maximum number of log files to keep. The default is 10, and the size of a single log + file is limited to 64 MB. Adjustment is not supported yet. + +Specifically, by setting `mq.consoleAppender.enabled` to true, you can output client logs to the console simultaneously +if you need debugging. + ## Publishing Steps 1. Open the command prompt, and change the directory to the project folder that you want to package. -2. Run the `dotnet pack --configuration Release` command. This will create a NuGet package in the `bin/Release` folder of the project. -3. To upload the package to NuGet, go to the NuGet website and sign in. Click on the "Upload" button and select the package file from the `bin/Release` folder. -4. Follow the instructions on the website to complete the upload process. Once the package is uploaded, it will be available for others to download and use. +2. Run the `dotnet pack --configuration Release` command. This will create a NuGet package in the `bin/Release` folder + of the project. +3. To upload the package to NuGet, go to the NuGet website and sign in. Click on the "Upload" button and select the + package file from the `bin/Release` folder. +4. Follow the instructions on the website to complete the upload process. Once the package is uploaded, it will be + available for others to download and use. diff --git a/java/README.md b/java/README.md index d7089ff7..b97014bf 100644 --- a/java/README.md +++ b/java/README.md @@ -67,4 +67,4 @@ The following logging parameters are all supported for specification by JVM syst * `rocketmq.log.root`: the root directory of the log output, default is `$HOME/logs/rocketmq`, so the full path is `$HOME/logs/rocketmq/rocketmq-client.log`. * `rocketmq.log.file.maxIndex`: the maximum number of log files to keep, default is 10 (the size of a single log file is limited to 64 MB, no adjustment is supported now). -Specifically, by setting `mq.consoleAppender.enabled` to 'true,' you can output client logs to the console simultaneously if you need debugging. +Specifically, by setting `mq.consoleAppender.enabled` to true, you can output client logs to the console simultaneously if you need debugging.
