Fix semantic logging bug #701#702
Merged
Aaronontheweb merged 7 commits intoJan 20, 2026
Merged
Conversation
Arkatufus
commented
Jan 20, 2026
Comment on lines
+81
to
+88
| state["ActorPath"] = path.ToString(); | ||
| state["Timestamp"] = log.Timestamp; | ||
| state["Thread"] = log.Thread.ManagedThreadId; | ||
| state["LogSource"] = log.LogSource; | ||
|
|
||
| // Add Akka metadata properties | ||
| state["ActorPath"] = path.ToString(); | ||
| state["Timestamp"] = log.Timestamp; | ||
| state["Thread"] = log.Thread.ManagedThreadId; | ||
| state["LogSource"] = log.LogSource; | ||
|
|
||
| // Add {OriginalFormat} key per MEL convention for structured logging | ||
| // This allows MEL sinks to recognize and preserve the message template | ||
| state["{OriginalFormat}"] = log.GetTemplate(); | ||
| // Add {OriginalFormat} key per MEL convention for structured logging | ||
| // This allows MEL sinks to recognize and preserve the message template | ||
| state["{OriginalFormat}"] = log.GetTemplate(); |
Contributor
Author
There was a problem hiding this comment.
Metadata will now always be included with the log
Comment on lines
+95
to
+106
| try | ||
| { | ||
| return log.ToString(); | ||
| } | ||
| catch | ||
| { | ||
| if(log.Message is LogMessage msg) | ||
| return $"Received a malformed formatted message. Log level: [{log.LogLevel()}], Template: [{msg.Format}], args: [{string.Join(",", msg.Unformatted())}]"; | ||
|
|
||
| return $"Received a malformed formatted message. Log level: [{log.LogLevel()}], Message: [{log.Message}]"; | ||
| } | ||
| }); |
Contributor
Author
There was a problem hiding this comment.
Actual fix, use the log message internal formatter
Comment on lines
+121
to
+133
| var sb = new StringBuilder(); | ||
|
|
||
| if(LogLevel is not null) | ||
| sb .Append("akka.loglevel=").AppendLine(ParseLogLevel(LogLevel).ToHocon()); | ||
|
|
||
| if(_loggers.Count > 0) | ||
| sb.Append("akka.loggers=[").Append(string.Join(",", _loggers.Select(t => $"\"{t.AssemblyQualifiedName}\""))).AppendLine("]"); | ||
|
|
||
| if(LogConfigOnStart is not null) | ||
| sb.Append("akka.log-config-on-start=").AppendLine(LogConfigOnStart.Value.ToHocon()); | ||
|
|
||
| if(_logMessageFormatter is not null) | ||
| sb.Append("akka.logger-formatter=").AppendLine(_logMessageFormatter.AssemblyQualifiedName.ToHocon()); |
Contributor
Author
There was a problem hiding this comment.
Make all option properties optional, options should not force specific HOCON values.
Aaronontheweb
approved these changes
Jan 20, 2026
| var loggers = config.GetStringList("akka.loggers"); | ||
| loggers.Count.Should().Be(1); | ||
| loggers[0].Should().Contain("Akka.Event.DefaultLogger"); | ||
| config.GetString("akka.logger-formatter").Should().Contain("SemanticLogMessageFormatter"); |
This was referenced Jan 26, 2026
Unable to set SemanticLogMessageFormatter as default because it doesn't have parameterless ctor
#703
Closed
This was referenced Jan 27, 2026
This was referenced Feb 9, 2026
This was referenced May 21, 2026
Open
Closed
Open
This was referenced Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #701
Changes
LoggerConfigBuilderproperties to be optionalChecklist
For significant changes, please ensure that the following have been completed (delete if not relevant):