You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (Jira)" <ji...@apache.org> on 2022/09/02 20:45:00 UTC

[jira] [Commented] (LOG4J2-3587) Cannot create Rfc5424Layout without enterpriseNumber after upgrading to 2.18.0

    [ https://issues.apache.org/jira/browse/LOG4J2-3587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17599708#comment-17599708 ] 

Ralph Goers commented on LOG4J2-3587:
-------------------------------------

It seems that the plugin was changed to now have

{code:java}
@PluginAttribute(value = "enterpriseNumber", defaultInt = -1)
{code}
I'm not sure why. This should be
{code:java}
@PluginAttribute(value = "enterpriseNumber", defaultInt = DEFAULT_ENTERPRISE_NUMBER)
{code}

> Cannot create Rfc5424Layout without enterpriseNumber after upgrading to 2.18.0
> ------------------------------------------------------------------------------
>
>                 Key: LOG4J2-3587
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3587
>             Project: Log4j 2
>          Issue Type: Bug
>    Affects Versions: 2.18.0
>            Reporter: Tomas Micko
>            Assignee: Piotr Karwasz
>            Priority: Minor
>
> Hello,
> I get an exception when using {{Rfc5424Layout}} after upgrading to 2.18.0 (but it works in 2.17.2). Using this configuration:
> {code:java}
> <Configuration>
>     <Appenders>
>         <Console name="stdout" target="SYSTEM_OUT">
>             <Rfc5424Layout />
>         </Console>
>     </Appenders>
> </Configuration> {code}
> I get this when starting my application:
> {code:java}
> java.lang.IllegalArgumentException: No enterprise number was supplied
> 	at org.apache.logging.log4j.message.StructuredDataId.<init>(StructuredDataId.java:169)
> 	at org.apache.logging.log4j.message.StructuredDataId.<init>(StructuredDataId.java:132)
> 	at org.apache.logging.log4j.core.layout.Rfc5424Layout.<init>(Rfc5424Layout.java:149)
> 	at org.apache.logging.log4j.core.layout.Rfc5424Layout.createLayout(Rfc5424Layout.java:643) {code}
> I need to specify an enterpriseNumber for Rfc5424Layout like this to make it work:
> {code:java}
> <Configuration>
>     <Appenders>
>         <Console name="stdout" target="SYSTEM_OUT">
>             <Rfc5424Layout enterpriseNumber="123456" />
>         </Console>
>     </Appenders>
> </Configuration> {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)