Re: [akka-user] Access to LoggingAdapter
If you are writing a custom graph stage, you can access it inside the GraphStageLogic from the ActorSystem like this: materializer match { case mat: ActorMaterializer => mat.logger case _ => throw new RuntimeException("this stage only works with an actor materializer") } Note that this may make the stage impossible to use with any future alternative materializers. -- Johan On Wed, Jul 13, 2016 at 9:54 PM, Richard Rodseth wrote: > Is there a way to get hold of the LoggingAdapter used by Akka streams? > > I'm making use of Viktor's Future retry > > https://gist.github.com/viktorklang/9414163 > > and someone would like me to log something in the retry case. So I thought > I would add an implicit LoggingAdapter parameter and supply it at the call > site (which is a mapAsync call). > > Thanks > > -- > >> Read the docs: http://akka.io/docs/ > >> Check the FAQ: > http://doc.akka.io/docs/akka/current/additional/faq.html > >> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to akka-user+unsubscr...@googlegroups.com. > To post to this group, send email to akka-user@googlegroups.com. > Visit this group at https://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
Re: [akka-user] Access to LoggingAdapter
No, I'm just in a function creating a flow that includes mapAsync(retry(somethingReturningFuture(..),...). Maybe I should just create an adapter at the beginning of the program and pass it as a parameter. On Wed, Jul 13, 2016 at 11:38 PM, Akka Team wrote: > If you are writing a custom graph stage, you can access it inside the > GraphStageLogic from the ActorSystem like this: > > materializer match { > case mat: ActorMaterializer => mat.logger > case _ => throw new RuntimeException("this stage only works with an actor > materializer") > } > > Note that this may make the stage impossible to use with any future > alternative materializers. > > -- > Johan > > On Wed, Jul 13, 2016 at 9:54 PM, Richard Rodseth > wrote: > >> Is there a way to get hold of the LoggingAdapter used by Akka streams? >> >> I'm making use of Viktor's Future retry >> >> https://gist.github.com/viktorklang/9414163 >> >> and someone would like me to log something in the retry case. So I >> thought I would add an implicit LoggingAdapter parameter and supply it at >> the call site (which is a mapAsync call). >> >> Thanks >> >> -- >> >> Read the docs: http://akka.io/docs/ >> >> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> >> Search the archives: https://groups.google.com/group/akka-user >> --- >> You received this message because you are subscribed to the Google Groups >> "Akka User List" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to akka-user+unsubscr...@googlegroups.com. >> To post to this group, send email to akka-user@googlegroups.com. >> Visit this group at https://groups.google.com/group/akka-user. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > >> Read the docs: http://akka.io/docs/ > >> Check the FAQ: > http://doc.akka.io/docs/akka/current/additional/faq.html > >> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to akka-user+unsubscr...@googlegroups.com. > To post to this group, send email to akka-user@googlegroups.com. > Visit this group at https://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
Re: [akka-user] Access to LoggingAdapter
but I'd recommend against that solution since it wouldn't necessarily be portable across materializer impls. -- Cheers, √ On Jul 14, 2016 08:39, "Akka Team" wrote: > If you are writing a custom graph stage, you can access it inside the > GraphStageLogic from the ActorSystem like this: > > materializer match { > case mat: ActorMaterializer => mat.logger > case _ => throw new RuntimeException("this stage only works with an actor > materializer") > } > > Note that this may make the stage impossible to use with any future > alternative materializers. > > -- > Johan > > On Wed, Jul 13, 2016 at 9:54 PM, Richard Rodseth > wrote: > >> Is there a way to get hold of the LoggingAdapter used by Akka streams? >> >> I'm making use of Viktor's Future retry >> >> https://gist.github.com/viktorklang/9414163 >> >> and someone would like me to log something in the retry case. So I >> thought I would add an implicit LoggingAdapter parameter and supply it at >> the call site (which is a mapAsync call). >> >> Thanks >> >> -- >> >> Read the docs: http://akka.io/docs/ >> >> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> >> Search the archives: https://groups.google.com/group/akka-user >> --- >> You received this message because you are subscribed to the Google Groups >> "Akka User List" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to akka-user+unsubscr...@googlegroups.com. >> To post to this group, send email to akka-user@googlegroups.com. >> Visit this group at https://groups.google.com/group/akka-user. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > >> Read the docs: http://akka.io/docs/ > >> Check the FAQ: > http://doc.akka.io/docs/akka/current/additional/faq.html > >> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to akka-user+unsubscr...@googlegroups.com. > To post to this group, send email to akka-user@googlegroups.com. > Visit this group at https://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
Re: [akka-user] Access to LoggingAdapter
The prior one that is, the adapter as a parameter sounds right. -- Johan On Thu, Jul 14, 2016 at 4:57 PM, Viktor Klang wrote: > but I'd recommend against that solution since it wouldn't necessarily be > portable across materializer impls. > > -- > Cheers, > √ > On Jul 14, 2016 08:39, "Akka Team" wrote: > >> If you are writing a custom graph stage, you can access it inside the >> GraphStageLogic from the ActorSystem like this: >> >> materializer match { >> case mat: ActorMaterializer => mat.logger >> case _ => throw new RuntimeException("this stage only works with an actor >> materializer") >> } >> >> Note that this may make the stage impossible to use with any future >> alternative materializers. >> >> -- >> Johan >> >> On Wed, Jul 13, 2016 at 9:54 PM, Richard Rodseth >> wrote: >> >>> Is there a way to get hold of the LoggingAdapter used by Akka streams? >>> >>> I'm making use of Viktor's Future retry >>> >>> https://gist.github.com/viktorklang/9414163 >>> >>> and someone would like me to log something in the retry case. So I >>> thought I would add an implicit LoggingAdapter parameter and supply it at >>> the call site (which is a mapAsync call). >>> >>> Thanks >>> >>> -- >>> >> Read the docs: http://akka.io/docs/ >>> >> Check the FAQ: >>> http://doc.akka.io/docs/akka/current/additional/faq.html >>> >> Search the archives: >>> https://groups.google.com/group/akka-user >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "Akka User List" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to akka-user+unsubscr...@googlegroups.com. >>> To post to this group, send email to akka-user@googlegroups.com. >>> Visit this group at https://groups.google.com/group/akka-user. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- >> >> Read the docs: http://akka.io/docs/ >> >> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> >> Search the archives: https://groups.google.com/group/akka-user >> --- >> You received this message because you are subscribed to the Google Groups >> "Akka User List" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to akka-user+unsubscr...@googlegroups.com. >> To post to this group, send email to akka-user@googlegroups.com. >> Visit this group at https://groups.google.com/group/akka-user. >> For more options, visit https://groups.google.com/d/optout. >> > -- > >> Read the docs: http://akka.io/docs/ > >> Check the FAQ: > http://doc.akka.io/docs/akka/current/additional/faq.html > >> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to akka-user+unsubscr...@googlegroups.com. > To post to this group, send email to akka-user@googlegroups.com. > Visit this group at https://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.