[
https://issues.apache.org/jira/browse/LOG4J2-2579?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrei Ivanov updated LOG4J2-2579:
----------------------------------
Description:
I've realized that it's a bit weird that event names are forcefully normalized
so I propose to remove this.
There are 2 ways to obtain/log an audit event:
1. {{org.apache.logging.log4j.audit.LogEventFactory#getEvent(Class<T>
intrface)}}, which accepts a Java interface and uses the simple name of that
interface as the event name
2. {{org.apache.logging.log4j.audit.AuditLogger#logEvent(String eventName,
Map<String, String> attributes)}}, which allows setting the event name as
{{String}}, and that name gets checked against the {{CatalogManager}}
I'm thinking that the normalization might have started as a way to make the
name obtained in the 1st case more friendly (or maybe there are some other
rules to apply regarding event names, from the parent project?), as the 2nd
case has maximum freedom to define the event name to start with or without an
upper case.
was:
I've realized that it's a bit weird that event names are forcefully normalized
so I propose to remove this.
There are 2 ways to obtain/log an audit event:
1. {{org.apache.logging.log4j.audit.LogEventFactory#getEvent(Class<T>
intrface)}}, which accepts a Java interface and uses the simple name of that
interface as the event name
2. {{org.apache.logging.log4j.audit.AuditLogger#logEvent(String eventName,
Map<String, String> attributes)}}, which allows setting the event name as
{{String}}, and that name gets checked against the {{CatalogManager}}
I'm thinking that the normalization might have started as a way to make the
name obtained in the 1st case, as the 2nd case has maximum freedom to define
the event name to start with or without an upper case.
> Don't normalize event names
> ---------------------------
>
> Key: LOG4J2-2579
> URL: https://issues.apache.org/jira/browse/LOG4J2-2579
> Project: Log4j 2
> Issue Type: Improvement
> Components: Log4j-Audit
> Affects Versions: Log4j-Audit 1.0.1
> Reporter: Andrei Ivanov
> Priority: Major
>
> I've realized that it's a bit weird that event names are forcefully
> normalized so I propose to remove this.
> There are 2 ways to obtain/log an audit event:
> 1. {{org.apache.logging.log4j.audit.LogEventFactory#getEvent(Class<T>
> intrface)}}, which accepts a Java interface and uses the simple name of that
> interface as the event name
> 2. {{org.apache.logging.log4j.audit.AuditLogger#logEvent(String eventName,
> Map<String, String> attributes)}}, which allows setting the event name as
> {{String}}, and that name gets checked against the {{CatalogManager}}
> I'm thinking that the normalization might have started as a way to make the
> name obtained in the 1st case more friendly (or maybe there are some other
> rules to apply regarding event names, from the parent project?), as the 2nd
> case has maximum freedom to define the event name to start with or without an
> upper case.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)