Not generating appenderRef in config?

Robert Nicholson <[email protected]>
Newsgroups gmane.comp.jakarta.log4j.user
Message-ID <[email protected]>
When I validate my config by using configurationBuilder.writeXmlConfiguration(System.out)

I notice most is there but the Loggers don’t have the AppenderRef entries.

Why is that?

When debugging I can see that when I call something like

rootLogger.add(configurationBuilder.newAppenderRef(“appenderName”));

in the debugger under Logger I can see it has a Component with the AppenderRef and the attributes of this ref match the name of the Appender
that appears as an Appender in Appenders off the ConfigurationBuilder.

ie. the Loggers components has both the attribute “ref” -> “appenderName” and the component is a AppenderRef pluginType

Why then does it choose to not include any AppenderRef for the logger in the Xml it’s showing me?

This is what my code looks like

RootLoggerComponentBuilder rootLogger = configurationBuilder.newRootLogger(Level.INFO);
configurationBuilder.add(rootLogger);
configurationBuilder.add(getAppender());
rootLogger.add(configurationBuilder.newAppenderRef(“filelog”));

after this it will show a root logger in the XML with no AppenderRef

Similar for all other subsequent loggers.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.