{"action":"created","issue":{"url":"https://api.github.com/repos/akka/akka/issues/17010","labels_url":"https://api.github.com/repos/akka/akka/issues/17010/labels{/name}","comments_url":"https://api.github.com/repos/akka/akka/issues/17010/comments","events_url":"https://api.github.com/repos/akka/akka/issues/17010/events","html_url":"https://github.com/akka/akka/issues/17010","id":59988398,"number":17010,"title":"Akka drops error logs on ActorSystem shutdown due to failed assert when using SLF4J","user":{"login":"RichardBradley","id":1265780,"avatar_url":"https://avatars.githubusercontent.com/u/1265780?v=3","gravatar_id":"","url":"https://api.github.com/users/RichardBradley","html_url":"https://github.com/RichardBradley","followers_url":"https://api.github.com/users/RichardBradley/followers","following_url":"https://api.github.com/users/RichardBradley/following{/other_user}","gists_url":"https://api.github.com/users/RichardBradley/gists{/gist_id}","starred_url":"https://api.github.com/users/RichardBradley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RichardBradley/subscriptions","organizations_url":"https://api.github.com/users/RichardBradley/orgs","repos_url":"https://api.github.com/users/RichardBradley/repos","events_url":"https://api.github.com/users/RichardBradley/events{/privacy}","received_events_url":"https://api.github.com/users/RichardBradley/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/akka/akka/labels/1%20-%20triaged","name":"1 - triaged","color":"5319e7"},{"url":"https://api.github.com/repos/akka/akka/labels/bug","name":"bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-05T17:48:33Z","updated_at":"2015-03-06T10:03:33Z","closed_at":null,"body":"We have found that certain types of TCP connections seem to crash our Akka HTTP 1.0-M3 app.\r\nI’ll raise a separate issue for that when I can get a sensibly isolated repro case.\r\nThis issue tracks the more worrying problem that Akka exits without logging any failure info in that case, making this extremely difficult to track down.\r\n\r\nAfter much struggle, I believe that the issue is that the entire message queue of the `Slf4jLogger` actor is discarded on `ActorSystem` shutdown.\r\nIn our case, this includes the enqueued \"`ERROR`\" log describing the System Guardian actor failure.\r\n\r\nI have uploaded a repro project at https://gist.github.com/RichardBradley/f7b1b7c3358779e3559d \r\nIf you run this with \"`sbt run`\", you will see that \"`myApp.log`\" has lots of log messages, but that it does not include all log messages that were enqueued, and importantly it does not include the details of the Actor assertion failure which was escalated and caused ActorSystem shutdown.\r\n\r\nWhat can I do to ensure that errors which are fatal to the ActorSystem get logged, if I am using SLF4J / Logback?\r\n\r\n\r\nWith respect, why does Akka have its own logging system based on Actors in the first place? Perhaps Akka should be calling SLF4J directly, using an \"`AsyncAppender`\" to give non-blocking behaviour? That would solve this issue (the appender's queue is drained on JVM exit by Logback), and perhaps many others.\r\n\r\nThanks,\r\n\r\n\r\nRich\r\n"},"comment":{"url":"https://api.github.com/repos/akka/akka/issues/comments/77534774","html_url":"https://github.com/akka/akka/issues/17010#issuecomment-77534774","issue_url":"https://api.github.com/repos/akka/akka/issues/17010","id":77534774,"user":{"login":"RichardBradley","id":1265780,"avatar_url":"https://avatars.githubusercontent.com/u/1265780?v=3","gravatar_id":"","url":"https://api.github.com/users/RichardBradley","html_url":"https://github.com/RichardBradley","followers_url":"https://api.github.com/users/RichardBradley/followers","following_url":"https://api.github.com/users/RichardBradley/following{/other_user}","gists_url":"https://api.github.com/users/RichardBradley/gists{/gist_id}","starred_url":"https://api.github.com/users/RichardBradley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RichardBradley/subscriptions","organizations_url":"https://api.github.com/users/RichardBradley/orgs","repos_url":"https://api.github.com/users/RichardBradley/repos","events_url":"https://api.github.com/users/RichardBradley/events{/privacy}","received_events_url":"https://api.github.com/users/RichardBradley/received_events","type":"User","site_admin":false},"created_at":"2015-03-06T10:03:33Z","updated_at":"2015-03-06T10:03:33Z","body":"I had thought that this issue was entirely related to the message queue of the `Slf4jLogger` actor, but actually the minimised example I've just uploaded to #17015 crashes without logging the failed assert when using Akka's default logging setup (no SLF4J at all!). Perhaps there is more than one issue at play here."}}