I'm trying to log info and errors into app. insights using opencensus-ext-azure but I can't find the traces in the logs,and only some exceptions are getting logged. Checked after an hour as well couldn't find them. Below is the code which I'm using for logging.
import logging
from opencensus.ext.azure.log_exporter import AzureLogHandler
def logger(ikey):
logs = logging.getLogger(__name__)
logs.addHandler(
AzureLogHandler(
connection_string='InstrumentationKey={}'.format(ikey)
)
)
return logs
ikey = 'ae52db35-5eeb-4eda-******'
logs = logger(ikey)
logs.info(f'APPINSIGHTS_INSTRUMENTATIONKEY is :{ikey}')
logs.info('Sample log message to check.')
logs.exception("RunTime error")
but based on the documentation I should be able to see the info logs in traces but I don't, below is the snapshot of traces and exception logs.
when I check the vars(logs) i get the following
{
'filters': [],
'name': '__main__',
'level': 0,
'parent': <RootLogger root (WARNING)>,
'propagate': True,
'handlers': [<AzureLogHandler (NOTSET)>],
'disabled': False,
'_cache': {},
'manager': <logging.Manager at 0x7f8b20239340>
}