akkadotnet / akka.logger.log4net Goto Github PK
View Code? Open in Web Editor NEWAkka.NET logging integration for Log4Net library
License: Apache License 2.0
Akka.NET logging integration for Log4Net library
License: Apache License 2.0
The Akka.Logger.log4net NuGet is not compatible with recent Akka NuGets. I suspect it is due to changes in ILoggingAdapter, where methods have been moved to an extension class.
Please make a new NuGet available with updated Akka and log4net NuGets.
[ERROR][07.25.2023 07:49:48.881Z][Thread 0025][akka://xxx/system/log1-Log4NetLogger] Method not found: 'Void Akka.Event.ILoggingAdapter.Info(System.String, System.Object[])'. Cause: System.MissingMethodException: Method not found: 'Void Akka.Event.ILoggingAdapter.Info(System.String, System.Object[])'. at Akka.Logger.log4net.Log4NetLogger.<.ctor>b__2_8(InitializeLogger m) at lambda_method12(Closure, Object, Action
1, Action1, Action
1, Action1, Action
1)
at Akka.Tools.MatchHandler.PartialHandlerArgumentsCapture6.Handle(T value) at Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(Object message, PartialAction
1 partialAction)
at Akka.Actor.ReceiveActor.OnReceive(Object message)
at Akka.Actor.UntypedActor.Receive(Object message)
at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
at Akka.Actor.ActorCell.ReceiveMessage(Object message)
at Akka.Actor.ActorCell.Invoke(Envelope envelope)`
Once akkadotnet/akka.net#1774 is merged in and released, we'll need to tag Log4NetLogger
with IRequiresMessageQueue<ILoggerMessageQueueSemantics>
.
Let's use GitHub Actions and the simplified build system we're running for Akka.Analyzers: https://github.com/akkadotnet/akka.analyzers
Version Information
Version of Akka.NET? 1.4.51
Which Akka.NET Modules? Akka.Logger.log4net
version 1.3.1
Describe the bug
We are using log4net
and the corresponding Akka.Logger.log4net
integration. The log messages originating from Akka.NET as well as from our own actors (which are using the ILoggingAdapter
returned by Context.GetLogger()
method) always have this ? lambda_method
text as part of the message:
2024-03-26 12:02:06,863 [11] INFO ? lambda_method - Starting remoting
Note that log messages not originating from Akka.NET related components don't look like this:
024-03-26 12:02:09,575 [ServiceThread] INFO Some.Class.Name SomeMethodName - Some log message
Our log4net
logger configuration section which configures the "layout" of log messages looks like this:
<appender name=...>
<layout type="log4net.Layout.PatternLayout">
<!-- %d = date, %t = thread, %p = property, %C = type, %M = method, %m = message, %n = newline -->
<param name="ConversionPattern" value="%d [%t] %p %C %M - %m%n"/>
</layout>
</appender>
To Reproduce
Steps to reproduce the behavior:
log4net
logger for Akka.akka.loggers = ["Akka.Logger.log4net.Log4NetLogger, Akka.Logger.log4net"]
log4net
appender configuration which contains a <layout ...>
section as shown above.Expected behavior
We shouldn't see this ? lambda_method
part in the log message.
Actual behavior
This is how log messages Akka.NET itself logs look like:
2024-03-27 14:07:45,121 [69] INFO ? lambda_method - Starting remoting
2024-03-27 14:07:45,396 [72] INFO ? lambda_method - Remoting started; listening on addresses : [akka.ssl.tcp://MyActorSystem@localhost:1234]
2024-03-27 14:07:45,398 [11] INFO ? lambda_method - Remoting now listens on addresses: [akka.ssl.tcp://MyActorSystem@localhost:1234]
2024-03-27 14:07:45,438 [12] INFO ? lambda_method - Cluster Node [akka.ssl.tcp://MyActorSystem@localhost:1234] - Starting up...
2024-03-27 14:07:45,478 [69] INFO ? lambda_method - Cluster Node [akka.ssl.tcp://MyActorSystem@localhost:1234] - Started up successfully
Environment
Windows 10 22H2
.NET Framework 4.8
Additional context
In the Discord channel akkadotnet-help
"Dopare" mentioned that:
[...] that library is not using LogEvent's LogSource property at all
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.