New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customizable ILogMessageFormatter
across entire ActorSystem
#6413
Customizable ILogMessageFormatter
across entire ActorSystem
#6413
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Detailed my changes
@@ -1720,6 +1720,7 @@ namespace Akka.Actor | |||
public int LogDeadLetters { get; } | |||
public bool LogDeadLettersDuringShutdown { get; } | |||
public System.TimeSpan LogDeadLettersSuspendDuration { get; } | |||
public Akka.Event.ILogMessageFormatter LogFormatter { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exposed the ILogMessageFormatter
on the Settings
class.
@@ -3000,7 +3001,7 @@ namespace Akka.Event | |||
public Akka.Actor.IActorRef Sender { get; } | |||
public override string ToString() { } | |||
} | |||
public class BusLogging : Akka.Event.LoggingAdapterBase | |||
public sealed class BusLogging : Akka.Event.LoggingAdapterBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sealed
BusLogging
and I'm considering making the constructor private in a subsequent PR so it can't be new
'd up any longer - and will instead have to be populated by the ActorSystem
. Considering doing that in order to enforce that configurable components like the ILogMessageFormatter
and others are injected consistently across all call sites.
} | ||
|
||
[Fact] | ||
public async Task ShouldUseValidCustomLogFormatter() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validates that custom ILogMessageFormatter
output actually makes it into the output events
} | ||
|
||
[Fact] | ||
public async Task ShouldDetectCustomLogFormatterOutputInEventFilter() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validates that the TestKit's EventFilter
can also pick up custom formatter output.
I've updated the logging page and the serilog page in the documentation to reflect use of this feature. Have not updated the "what's new in v1.5" page yet (planning on doing that closer to release time.) |
ILogMessageFormatter
across entire ActorSystem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, just one question on the documentation
docs/articles/utilities/logging.md
Outdated
--- | ||
|
||
# Logging | ||
|
||
For more info see real Akka's documentation: <http://doc.akka.io/docs/akka/2.0/scala/logging.html> | ||
> ![NOTE] | ||
> For info |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty documentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like I got interrupted mid-sentence. I'll go finish that.
Changes
Makes it possible to configure the
ILoggerMessageFormatter
across the entireActorSystem
via HOCON. This is one of the ingredients we need in order to enable semantic logging in Akka.NET by default.This PR also has the benefit of removing this extremely annoying piece of Akka.Logging.Serilog syntax:
Checklist
For significant changes, please ensure that the following have been completed (delete if not relevant):