hseeberger / akka-log4j Goto Github PK
View Code? Open in Web Editor NEWLogging backend for Akka based on Log4j
License: Apache License 2.0
Logging backend for Akka based on Log4j
License: Apache License 2.0
when i'm trying to run an app this issue occurs:
[ERROR] [07/29/2017 10:38:46.509] [system-akka.actor.default-dispatcher-2] [akka://system/system/log1-Log4jLogger] head of empty list
java.util.NoSuchElementException: head of empty list
at scala.collection.immutable.Nil$.head(List.scala:420)
at scala.collection.immutable.Nil$.head(List.scala:417)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)
at akka.actor.ActorCell.invoke(ActorCell.scala:495)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)
at akka.dispatch.Mailbox.run(Mailbox.scala:224)
at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
[ERROR] [07/29/2017 10:38:46.524] [system-akka.actor.default-dispatcher-2] [akka://system/system/log1-Log4jLogger] changing Recreate into Create after java.util.NoSuchElementException: head of empty list
[ERROR] [SECURITY][07/29/2017 10:38:46.872] [system-akka.actor.default-dispatcher-2] [akka.actor.ActorSystemImpl(system)] Uncaught error from thread [system-akka.actor.default-dispatcher-2] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
Uncaught error from thread [system-akka.actor.default-dispatcher-2] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[system]
java.lang.NoSuchMethodError: akka.actor.Actor.$init$(Lakka/actor/Actor;)V
at de.heikoseeberger.akkalog4j.Log4jLogger.<init>(Log4jLogger.scala:61)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at akka.util.Reflect$.instantiate(Reflect.scala:44)
at akka.actor.NoArgsReflectConstructor.produce(IndirectActorProducer.scala:105)
at akka.actor.Props.newActor(Props.scala:213)
at akka.actor.ActorCell.newActor(ActorCell.scala:562)
at akka.actor.ActorCell.create(ActorCell.scala:588)
at akka.actor.dungeon.FaultHandling$class.finishCreate(FaultHandling.scala:136)
at akka.actor.dungeon.FaultHandling$class.faultCreate(FaultHandling.scala:130)
at akka.actor.ActorCell.faultCreate(ActorCell.scala:374)
at akka.actor.dungeon.FaultHandling$class.faultRecreate(FaultHandling.scala:59)
at akka.actor.ActorCell.faultRecreate(ActorCell.scala:374)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:464)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:483)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:282)
at akka.dispatch.Mailbox.run(Mailbox.scala:223)
at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
there is a simple project affected by this issue
https://github.com/sshaddicts/neuralswarm/tree/issue-with-log4j2
Hi @hseeberger, thanks for the great library!
Support for logging Message objects directly would be very beneficial for structured logging, something most libraries do using MDC. MDC, however, is not threadsafe and generally painful to use in Akka (can't log from Future callbacks, for example).
I'll gladly send a PR for this feature. What do you think?
Hi,
When adding akka-log4j I'm receiving the following error message:
[ERROR] SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
[ERROR] SLF4J: Defaulting to no-operation (NOP) logger implementation
[ERROR] SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
This can be easily fixed by adding the following dependency:
"org.apache.logging.log4j" % "log4j-slf4j-impl" % Version.Log4j
It prevents other projects from having to add this library themselves.
BR,
Miel
Can you add example how to use it?
I just tested my application with Log4j 2.6 and it wouldn't even start, no error message, etc, I'm not sure if is related to akka-log4j or log4j 2.6 issue, I'm wondering if it can be reproduced by trying to run the tests?
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.