Git Product home page Git Product logo

akka.logger.log4net's People

Contributors

aaronontheweb avatar alexvaluyskiy avatar arkatufus avatar danthar avatar dependabot[bot] avatar horusiath avatar sean-gilliam avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

akka.logger.log4net's Issues

Not working with latest Akka NuGets

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, Action1, Action1, Action1, Action1, Action1)
at Akka.Tools.MatchHandler.PartialHandlerArgumentsCapture6.Handle(T value) at Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(Object message, PartialAction1 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)`

Log messages always have this "? lambda_method" text as part of the message

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:

  1. Configure the log4net logger for Akka.
    akka.loggers = ["Akka.Logger.log4net.Log4NetLogger, Akka.Logger.log4net"]
  2. Use a log4net appender configuration which contains a <layout ...> section as shown above.
  3. Let an actor log some message.

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.