Search code examples
androidlogginggoogle-cloud-platformlogback

Is there a way to log events from my Android application to Stackdriver with logback-android?


I am looking for the most convenient way to log entries from my Android application to Stackdriver. My code is in Kotlin using the Flutter framework.

I am already using logback-android due to its usage by a library I'm dependent on, so a SLF4J appender to Stackdriver would be most suitable but I couldn't find anything like it. I also tried using the Google Cloud Logging Library but it seems to not support Kotlin.


Solution

  • After a day of thinking about this issue, and due to the fact that a service account shouldn't be located at the client-side (the Flutter app), I realized the best way is to implement a \log endpoint at the server-side and send logs using authenticated requests.