client-python icon indicating copy to clipboard operation
client-python copied to clipboard

Bug: Extra metadata in logs (meta / attributes) is no longer serialized in JSON output

Open Oskar65536 opened this issue 4 months ago • 0 comments

Description

Hi guys, After commit 0829b0cb29edd9a82cee8d5e547523b603eae720, JSON logging no longer includes the extra metadata passed to logger methods.

For example, here we can see this code:

self.opencti.app_logger.error(
            "Unknown object type, doing nothing...", {"type": stix_object["type"]}
        )

It outputs only the string "Unknown object type, doing nothing...".

So maybe here:

formatter = CustomJsonFormatter("%(timestamp)s %(level)s %(name)s %(message)s")

it's better to use this:

formatter = CustomJsonFormatter("%(timestamp)s %(level)s %(name)s %(message)s %(attributes)s")

Oskar65536 avatar Oct 12 '25 17:10 Oskar65536