Public | Automated Build

Last pushed: 9 months ago
Short Description
Android of the log is a project to be able to display in StackDriver of GCP
Full Description

Android of the log is a project to be able to display in StackDriver of GCP.
Logs are sent to the XMPP server in the GCM, and sends it to the StackDriver Log of GCP.

Android -> GCM -> XMPP -> StackDriver


  1. create Log Forward Server
  2. Android log setting

#create Log forward Server



Install Docker Engine - Docker


Installing Cloud SDK | Cloud SDK Documentation | Google Cloud Platform

require settings

if use Google Compute Engine

GCP Network

network port tcp:8080 grpc

xmpp start from docker (example GCP)

gcloud auth login
docker-machine create -d google \
     --google-project <gcp_project_name> \
     --google-zone asia-northeast1-c \
     --google-machine-type "f1-micro" \
     --google-machine-image \
eval $(docker-machine env xmpp)
docker run --name android_stackdriver_log -d -e SENDER_ID='your FCM sender id' -e SERVER_KEY='your FCM server key' shikajiro/android_stackdriver_log:0.4

Let's start Logging Server !!

docker log

docker logs android_stackdriver_log -f

Android log setting

need fcm(gcm) send process.

Log Setting Example (if use Timber)

    override fun onCreate() {

    private class DebugLogTree : Timber.DebugTree() {
        override fun log(priority: Int, tag: String, message: String, t: Throwable?) {
            super.log(priority, tag, message, t)

            if (priority == Log.VERBOSE || priority == Log.DEBUG || priority == Log.INFO) {
                Observable.create<Unit> {
                    val instanceId = FirebaseInstanceId.getInstance().id
                    val fm = FirebaseMessaging.getInstance()
                    // not ui thread.
                            .Builder(SENDER_ID + "")
                            .setMessageId(instanceId +"yyyyMMddHHmmss"))
                            .addData("log", message)
                            .addData("instanceId", instanceId)
                            .addData("priority", ""+priority)
                            .addData("tag", tag)
                }.subscribe {

Docker Pull Command

Comments (0)