change log destination
This commit is contained in:
+3
-3
@@ -33,7 +33,7 @@ LOG_APPOINTMENT_SUCCESS = "SUCCESS"
|
||||
|
||||
class LogSender:
|
||||
def __init__(self):
|
||||
self._config = oci.config.from_file("~/.oci/logger_config")
|
||||
self._config = oci.config.from_file("~/.oci/logger_config_appointment")
|
||||
self._identity = oci.identity.IdentityClient(self._config)
|
||||
self._loggingingestion_client = LoggingClient(self._config)
|
||||
|
||||
@@ -46,7 +46,7 @@ class LogSender:
|
||||
self.send_log(msg, type=LOG_APPOINTMENT_ERROR)
|
||||
|
||||
def send_log(self, msg: str, source=definitions.LOG_SOURCE, subject="appointment", type: str = "INFO"):
|
||||
log_id = "ocid1.log.oc1.eu-frankfurt-1.amaaaaaacvc3jtia5enufv5jxe6binq4ndaty7pt5mk7uidipfd62ynwdhnq"
|
||||
log_id = "ocid1.log.oc1.eu-frankfurt-1.amaaaaaas4ft22ya3ub6glkltqqbnmkxo3ui7xwq3dxtjd2scdhme4deyu2q"
|
||||
response = self._loggingingestion_client.put_logs(
|
||||
log_id=log_id,
|
||||
put_logs_details=PutLogsDetails(
|
||||
@@ -83,5 +83,5 @@ if __name__ == '__main__':
|
||||
logger = logging.getLogger()
|
||||
logger.addHandler(logging.StreamHandler(stream=sys.stdout))
|
||||
log_sender = LogSender()
|
||||
response = log_sender.send_log("test2")
|
||||
response = log_sender.send_log("test")
|
||||
print(response)
|
||||
|
||||
Reference in New Issue
Block a user