[
https://issues.apache.org/jira/browse/LOG4J2-3689?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
CHAN Shih-Ping updated LOG4J2-3689:
-----------------------------------
Description:
RFE: make enterprise number optional in XML config (not just
StructuredDataMessage)
Current: XML config of RFC5424Layout is strict in requiring enterpriseId in
LoggerFields. When logging a StructuredDataMessage, it is more relaxed and the
SD-ID can be a bare label (without the @enterpriseNumber).
OpenTelemetry has a recommended SD-ELEMENT that looks like this:
https://opentelemetry.io/docs/specs/otel/compatibility/logging_trace_context/
{{[opentelemetry trace_id="102981abcd2901" span_id="abcdef1010"
trace_flags="01"]}}
Problem statement: cannot create this LoggerFields in XML config as there is no
enterprise number.
What I tried:
* leave out enterpriseId attribute: result: got the default value
* set enterpriseId to -1(RESERVED): didn't work; XML would not parse
* set enterpriseId to "": didn't work as the at-sign is still appended when
creating a SD-ID
Proposal:
Have a manifest constant like NOATSIGN(= -2) as an enterpriseId placeholder
and when rendering the SD-ID leave out the trailing "@xxxx" part
This is not entirely spec compliant as RFC5424 states that no-at-sign SD-ID
namespace is reserved for IETF.
I'm not entirely sure how OpenTelemetry came up with its proposal.
was:
RFE: make enterprise number optional in XML config (not just
StructuredDataMessage)
Current: XML config of RFC5424Layout is strict in requiring enterpriseId in
LoggerFields. When logging a StructuredDataMessage, it is more relaxed and the
SD-ID can be a bare label (without the @enterpriseNumber).
OpenTelemetry has a recommended SD-ELEMENT that looks like this:
https://opentelemetry.io/docs/specs/otel/compatibility/logging_trace_context/
{{[opentelemetry trace_id="102981abcd2901" span_id="abcdef1010"
trace_flags="01"]}}
Problem statement: cannot create this LoggerFields in XML config as there is no
enterprise number.
What I tried:
* leave out enterpriseId attribute: result: got the default value
* set enterpriseId to -1(RESERVED): didn't work; XML would not parse
* set enterpriseId to "": didn't work as the @ symbol is still appended when
creating a SD-ID
> [RFE RFC5424]: Make enterpriseID be optional in XML config e.g for
> OpenTelemetry
> --------------------------------------------------------------------------------
>
> Key: LOG4J2-3689
> URL: https://issues.apache.org/jira/browse/LOG4J2-3689
> Project: Log4j 2
> Issue Type: New Feature
> Components: Core
> Affects Versions: 2.19.0
> Reporter: CHAN Shih-Ping
> Priority: Minor
>
> RFE: make enterprise number optional in XML config (not just
> StructuredDataMessage)
> Current: XML config of RFC5424Layout is strict in requiring enterpriseId in
> LoggerFields. When logging a StructuredDataMessage, it is more relaxed and
> the SD-ID can be a bare label (without the @enterpriseNumber).
>
> OpenTelemetry has a recommended SD-ELEMENT that looks like this:
> https://opentelemetry.io/docs/specs/otel/compatibility/logging_trace_context/
> {{[opentelemetry trace_id="102981abcd2901" span_id="abcdef1010"
> trace_flags="01"]}}
>
> Problem statement: cannot create this LoggerFields in XML config as there is
> no enterprise number.
>
> What I tried:
> * leave out enterpriseId attribute: result: got the default value
> * set enterpriseId to -1(RESERVED): didn't work; XML would not parse
> * set enterpriseId to "": didn't work as the at-sign is still appended when
> creating a SD-ID
> Proposal:
> Have a manifest constant like NOATSIGN(= -2) as an enterpriseId placeholder
> and when rendering the SD-ID leave out the trailing "@xxxx" part
> This is not entirely spec compliant as RFC5424 states that no-at-sign SD-ID
> namespace is reserved for IETF.
> I'm not entirely sure how OpenTelemetry came up with its proposal.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)