Stackdriver logging from Kubernetes Engine CronJob not showing

9/14/2018

I'm trying to set up stackdriver logging according to the documentation: https://cloud.google.com/logging/docs/setup/nodejs, in particular using the bunyan plugin.

I am trying to consolidate my logs from my cronjobs (deployed using GKE), and can see the logs when I click in from the GKE console into the pod container logs.

However, I am unable to find them in Stackdriver console when I search for either text: [logger-name], or even from selecting Kubernetes Cluster resource. I was able, however, to do it from my local machine and even tried uploading a service key when instantiating my Logger instance below, but to no avail.

    const bunyan = require("bunyan");
    // Imports the Google Cloud Client Library for Bunyan
    const {LoggingBunyan} = require("@google-cloud/logging-bunyan");

    // Creates a Bunyan Stackdriver Logging client
    const loggingBunyan = new LoggingBunyan({
        keyFilename: './keys/cron-job-logging.json'
    });

Would like to seek advice on what I missed out?

-- jlyh
cron
google-cloud-platform
google-cloud-stackdriver
google-kubernetes-engine

0 Answers