Skip to content

LogValueMapFactory Should Return UnmodifiableMap #8

Description

@vjkoskela

The Builder for LogValueMapFactory should return an unmodifiable map. However, the type of map returned is used to trigger custom serialization of log value maps. In particular, it is used to inject bean identifier attributes (e.g. "_id" and "_class") when the encoder is configured with "injectBeanIdentifier".

So simply wrapping the LogValueMap in a Collections.unmodifiableMap will break type-based serializer selection. Either we need to overload the serializer for Java's unmodifiable map and in the new custom serializer examine the underlying map reflectively and then decide how to serialize. Alternatively, we need to write a custom unmodifiable map delegate class as the UnmodifiableMap class is private in Java's Collections.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions