Skip to content

Commit

Permalink
Update RELEASE_NOTES.md for v0.4.1 release (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkatufus authored Jul 21, 2022
1 parent 173e944 commit a52690c
Showing 1 changed file with 53 additions and 11 deletions.
64 changes: 53 additions & 11 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,39 @@
## [0.4.0] / 18 July 2022
- [Add `Microsoft.Extensions.Logging.ILoggerFactory` logging support](https://github.com/akkadotnet/Akka.Hosting/pull/72)
## [0.4.1] / 21 July 2022
- [Fix `Microsoft.Extensions.Logging.ILoggerFactory` logging support](https://github.com/akkadotnet/Akka.Hosting/pull/81)
- [Add `InMemory` snapshot store and journal persistence support](https://github.com/akkadotnet/Akka.Hosting/pull/84)

You can now use `ILoggerFactory` from Microsoft.Extensions.Logging as one of the sinks for Akka.NET logger. This logger will use the `ILoggerFactory` service set up inside the dependency injection `ServiceProvider` as its sink.
Due to a bad API design, we're rolling back the `Microsoft.Extensions.Logging.ILoggerFactory` logger support introduced in version 0.4.0, the 0.4.0 NuGet version is now considered as deprecated in support of the new API design introduced in version 0.4.1.

__Logger Configuration Support__

You can now use the new `AkkaConfigurationBuilder` extension method called `ConfigureLoggers(Action<LoggerConfigBuilder>)` to configure how Akka.NET logger behave.

Example:
```
builder.Services.AddAkka("MyActorSystem", (configurationBuilder, serviceProvider) =>
```csharp
builder.Services.AddAkka("MyActorSystem", configurationBuilder =>
{
configurationBuilder
.AddHocon("akka.loglevel = DEBUG")
.WithLoggerFactory()
.ConfigureLoggers(setup =>
{
// Example: This sets the minimum log level
setup.LogLevel = LogLevel.DebugLevel;

// Example: Clear all loggers
setup.ClearLoggers();

// Example: Add the default logger
// NOTE: You can also use setup.AddLogger<DefaultLogger>();
setup.AddDefaultLogger();

// Example: Add the ILoggerFactory logger
// NOTE:
// - You can also use setup.AddLogger<LoggerFactoryLogger>();
// - To use a specific ILoggerFactory instance, you can use setup.AddLoggerFactory(myILoggerFactory);
setup.AddLoggerFactory();

// Example: Adding a serilog logger
setup.AddLogger<SerilogLogger>();
})
.WithActors((system, registry) =>
{
var echo = system.ActorOf(act =>
Expand All @@ -25,11 +49,23 @@ builder.Services.AddAkka("MyActorSystem", (configurationBuilder, serviceProvider
});
```

There are two `Akka.Hosting` extension methods provided:
- `.WithLoggerFactory()`: Replaces all Akka.NET loggers with the new `ILoggerFactory` logger.
- `.AddLoggerFactory()`: Inserts the new `ILoggerFactory` logger into the Akka.NET logger list.
A complete code sample can be viewed [here](https://github.com/akkadotnet/Akka.Hosting/tree/dev/src/Examples/Akka.Hosting.LoggingDemo).

Exposed properties are:
- `LogLevel`: Configure the Akka.NET minimum log level filter, defaults to `InfoLevel`
- `LogConfigOnStart`: When set to true, Akka.NET will log the complete HOCON settings it is using at start up, this can then be used for debugging purposes.

__Log Event Filtering__
Currently supported logger methods:
- `ClearLoggers()`: Clear all registered logger types.
- `AddLogger<TLogger>()`: Add a logger type by providing its class type.
- `AddDefaultLogger()`: Add the default Akka.NET console logger.
- `AddLoggerFactory()`: Add the new `ILoggerFactory` logger.

__Microsoft.Extensions.Logging.ILoggerFactory Logging Support__

You can now use `ILoggerFactory` from Microsoft.Extensions.Logging as one of the sinks for Akka.NET logger. This logger will use the `ILoggerFactory` service set up inside the dependency injection `ServiceProvider` as its sink.

__Microsoft.Extensions.Logging Log Event Filtering__

There will be two log event filters acting on the final log input, the Akka.NET `akka.loglevel` setting and the `Microsoft.Extensions.Logging` settings, make sure that both are set correctly or some log messages will be missing.

Expand All @@ -47,3 +83,9 @@ To set up the `Microsoft.Extensions.Logging` log filtering, you will need to edi
}
}
```

__InMemory Snapshot Store And Journal Support__

You can now use these `AkkaConfigurationBuilder` extension methods to enable `InMemory` persistence back end:
- `WithInMemoryJournal()`: Sets the `InMemory` journal as the default journal persistence plugin
- `WithInMemorySnapshotStore()`: Sets the `InMemory` snapshot store as the default snapshot-store persistence plugin.

0 comments on commit a52690c

Please sign in to comment.