https://github.com/jjm-one/jjm.one.serilog.extensions.logging.helpers
A collection of helper functions for the Serilog logging tool.
https://github.com/jjm-one/jjm.one.serilog.extensions.logging.helpers
csharp extension logging serilog serilog-extension
Last synced: 3 months ago
JSON representation
A collection of helper functions for the Serilog logging tool.
- Host: GitHub
- URL: https://github.com/jjm-one/jjm.one.serilog.extensions.logging.helpers
- Owner: jjm-one
- License: other
- Created: 2023-02-01T10:23:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-09T01:43:19.000Z (7 months ago)
- Last Synced: 2025-03-26T17:11:21.843Z (4 months ago)
- Topics: csharp, extension, logging, serilog, serilog-extension
- Language: C#
- Homepage: https://jjm-one.github.io/jjm.one.Serilog.Extensions.Logging.Helpers/
- Size: 448 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# jjm.one.Serilog.Extensions.Logging.Helpers
A collection of helper functions for the [Serilog.Extensions.Logging](https://www.nuget.org/packages/Serilog.Extensions.Logging) logging tool.
## Status
| | |
|----------------------:|-----------------------|
| Build & Test Status (main) | [](https://github.com/jjm-one/jjm.one.Serilog.Extensions.Logging.Helpers/actions/workflows/dotnet.yml) |
| Nuget Package Version | [](https://www.nuget.org/packages/jjm.one.Serilog.Extensions.Logging.Helpers/) |
| SonarCloudQuality Gate Status | [](https://sonarcloud.io/summary/new_code?id=jjm-one_jjm.one.Serilog.Extensions.Logging.Helpers) |## Table of contents
- [jjm.one.Serilog.Extensions.Logging.Helpers](#jjmoneserilogextensionslogginghelpers)
- [Status](#status)
- [Table of contents](#table-of-contents)
- [Nuget Package](#nuget-package)
- [Installing the Nuget Package](#installing-the-nuget-package)
- [Usage](#usage)
- [Use function logging](#use-function-logging)
- [Output of function logging](#output-of-function-logging)
- [Full Documentation](#full-documentation)
- [Repo](#repo)## Nuget Package
You can get the latest version of this software as a nuget package form [nuget.org](https://www.nuget.org/packages/jjm.one.Serilog.Extensions.Logging.Helpers/)
### Installing the Nuget Package
| Tool | Command/Code |
|----------------------|--------------|
| Package Manager | ```PM> Install-Package jjm.one.Serilog.Extensions.Logging.Helper -Version X.Y.Z``` |
| .NET CLI | ```> dotnet add package jjm.one.Serilog.Extensions.Logging.Helper --version X.Y.Z``` |
| PackageReference | `````` |
| Package CLI | ```> paket add jjm.one.Serilog.Extensions.Logging.Helper --version X.Y.Z``` |
| Script & Interactive | ```> #r "nuget: jjm.one.Serilog.Extensions.Logging.Helper, X.Y.Z"``` |
| Cake as Addin | ```#addin nuget:?package=jjm.one.Serilog.Extensions.Logging.Helper&version=X.Y.Z``` |
| Cake as Tool | ```#tool nuget:?package=jjm.one.Serilog.Extensions.Logging.Helper&version=X.Y.Z``` |## Usage
### Use function logging
```csharp
class MyClass {// ...
void MyFancyFunction() {
// log the function call (minimal parameters)
Log.Logger.LogFctCall();// log the function call (full parameters)
Log.Logger.LogFctCall(GetType(), MethodBase.GetCurrentMethod(), LogEventLevel.Debug);try {
//...
}
catch (Exception exc) {// Log the exception (minimal parameters)
Log.Logger.LogExcInFctCall(exc);// Log the exception (full parameters)
Log.Logger.LogExcInFctCall(exc, GetType(), MethodBase.GetCurrentMethod(), "My custom exception message!", LogEventLevel.Error);
}
}// ...
}
```### Output of function logging
```text
Function called: MyClass -> MyFancyFunction
Exception thrown in: MyClass -> MyFancyFunction
My custom exception message!
```## Full Documentation
The full documentation for this package can be found [here](https://jjm-one.github.io/jjm.one.Serilog.Extensions.Logging.Helpers/main/doc/html/index.html).
## Repo
The associated repo for this package can be found [here](https://github.com/jjm-one/jjm.one.Serilog.Extensions.Logging.Helpers).