You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.
I have a Django project and trying to use this module to push application logs to pubsub asynchronously. I am trying to test with below configuration and it is failing. At the same time creating handler object and registering is working as expected.
from __future__ import print_function
import logging
import os
import argparse
import logging
import logging.config
import logging.handlers
import time
from pubsub_logging import AsyncPubsubHandler
from pubsub_logging import PubsubHandler
from pubsub_logging import utils
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "../../vrm/Premium-POC-108be31ed325.json"
logging.config.fileConfig(os.path.join('.','logging.conf'))
logger = logging.getLogger('root')
logger.setLevel(logging.DEBUG)
num=3
for i in range(num):
logger.info('pubsub %03d.', i)
print("done")
publish_body = utils.publish_body
pubsub_handler = AsyncPubsubHandler('projects/nextgenxcoding/topics/vm-response', 10,
publish_body=publish_body)
logger = logging.getLogger('root')
logger.setLevel(logging.DEBUG)
logger.addHandler(pubsub_handler)
before = time.time()
for i in range(num):
logger.info('log message %03d.', i)
elapsed = time.time() - before
print('Took %f secs for buffering %d messages: %f mps.\n' %
(elapsed, num, num/elapsed))
pubsub_handler.flush()
elapsed = time.time() - before
print('Took %f secs for sending %d messages: %f mps.\n' %
(elapsed, num, num/elapsed))
I have a Django project and trying to use this module to push application logs to pubsub asynchronously. I am trying to test with below configuration and it is failing. At the same time creating handler object and registering is working as expected.
from gcloud command
The text was updated successfully, but these errors were encountered: