Skip to content

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

@Oskar65536

Description

@Oskar65536

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    buguse for describing something not working as expected

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions