1

ISSUE: Not able to create named logs

CODE:

    from google.cloud import logging
    client = logging.Client()
    # client = logging.Client.from_service_account_json('credentials.json')
    logger1 = client.logger("my_new_log_1")
    logger1.log_text("hello logger 1") 
    logger2 = client.logger("my_new_log_2")
    logger2.log_text("hello logger 2") 

ERROR: 'module' object has no attribute 'info'

This code needs to run on Google App Engine Standard

Brian B
  • 191
  • 8
  • 1
    Possible duplicate of [Error using Google Stackdriver Logging in App Engine Standard python](https://stackoverflow.com/questions/47223678/error-using-google-stackdriver-logging-in-app-engine-standard-python) – Robbe Nov 24 '17 at 14:47

1 Answers1

0

The provided usage example, on the "Stackdriver Logging Client Libraries" documentation page, indicates a statement similar to the one below, prior to your "logger=" line:

The name of the log to write to log_name = 'my-log'

George
  • 1,488
  • 1
  • 10
  • 13
  • George, I updated the question, I would like to write from functions to named logs, maybe one process would log to an error log, another to success log. – Brian B Nov 24 '17 at 23:35
  • Is the answer provided by Robbe to question "Error using Google Stackdriver Logging in App Engine Standard python" correct, with the edit of the 27th of Nov.? https://stackoverflow.com/questions/47223678/error-using-google-stackdriver-logging-in-app-engine-standard-python – George Nov 30 '17 at 20:53