Skip to content

JsonLogFormatter unexpectedly squelches message(s) from Django? #40

@groovecoder

Description

@groovecoder

See https://github.com/mozilla/fx-private-relay/pull/82/files#r395097199 ... not sure why this code:

if message and not self.is_value_jsonlike(message):
fields["msg"] = message

is skipping log records where messages are already json-like? This means code like the following:

     logger.info({
         'event_type': 'email_relay',
         'relay_address_id': relay_address.id,
         'relay_address': sha256(local_portion.encode('utf-8')).hexdigest(),
         'real_address': sha256(
             relay_address.user.email.encode('utf-8')
         ).hexdigest(),
     })

Omits the dictionary from the output. So this outputs:

{"Timestamp": 1584647678788551936, "Type": "events", "Logger": "fx-private-relay", "Hostname": "groovetop", "EnvVersion": "2.0", "Severity": 6, "Pid": 4031, "Fields": {}}

?

Which makes no sense to me. Is there a different way I should be logging JSON-like objects via dockerflow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions