https://github.com/dosymep/serilog.sinks.autodesk.revit
The Autodesk Revit Journal sink for Serilog
https://github.com/dosymep/serilog.sinks.autodesk.revit
Last synced: about 1 year ago
JSON representation
The Autodesk Revit Journal sink for Serilog
- Host: GitHub
- URL: https://github.com/dosymep/serilog.sinks.autodesk.revit
- Owner: dosymep
- License: mit
- Created: 2023-05-30T13:28:10.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-21T09:36:20.000Z (about 2 years ago)
- Last Synced: 2025-04-04T17:17:01.402Z (about 1 year ago)
- Language: C#
- Homepage:
- Size: 38.1 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Serilog.Sinks.Autodesk.Revit
[](https://www.jetbrains.com/rider)
[](LICENSE.md)
[](https://www.autodesk.com/products/revit/overview)
[](https://github.com/dosymep/Serilog.Sinks.Autodesk.Revit/actions/workflows/main.yml)
Writes [Serilog](https://serilog.net) events to Autodesk Revit [Journal](https://www.revitapidocs.com/2022/97ec1eca-ab92-1cee-fdda-7bf3ce91c504.htm).
### Getting started
Install the [Serilog.Sinks.Autodesk.Revit](https://www.nuget.org/packages/Serilog.Sinks.Autodesk.Revit/) package from NuGet:
```powershell
Install-Package Serilog.Sinks.Autodesk.Revit
```
To configure the sink in C# code, call `WriteTo.RevitJournal()` during logger configuration:
```csharp
// IExternalCommand.Execute
public Result Execute(ExternalCommandData commandData,
out string message,
ElementSet elements) {
UIApplication uiApplication = commandData.Application;
var log = new LoggerConfiguration()
.WriteTo.RevitJournal(uiApplication)
.CreateLogger();
}
```
```csharp
// IExternalApplication.Execute
public Result OnStartup(UIControlledApplication application) {
var log = new LoggerConfiguration()
.WriteTo.RevitJournal(application)
.CreateLogger();
}
```