Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error in conf/log4j2.cli.xml #3299

Closed
RaulGracia opened this issue May 30, 2022 · 3 comments
Closed

Syntax error in conf/log4j2.cli.xml #3299

RaulGracia opened this issue May 30, 2022 · 3 comments
Assignees
Labels

Comments

@RaulGracia
Copy link
Contributor

BUG REPORT

Problem with log4j configuration when using bkctl tool.

To Reproduce

Steps to reproduce the behavior:
Used bkctl tool on a pod with Bookkeeper 4.15 deployed and observed the following error:

/opt/bookkeeper # bin/bkctl bookies list
[Fatal Error] log4j2.cli.xml:30:11: The element type "Appenders" must be terminated by the matching end-tag "</Appenders>".
ERROR StatusLogger Error parsing /opt/bookkeeper/conf/log4j2.cli.xml
 org.xml.sax.SAXParseException; systemId: file:///opt/bookkeeper/conf/log4j2.cli.xml; lineNumber: 30; columnNumber: 11; The element type "Appenders" must be terminated by the matching end-tag "</Appenders>".
	at java.xml/com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
	at java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
	at org.apache.logging.log4j.core.config.xml.XmlConfiguration.<init>(XmlConfiguration.java:94)
	at org.apache.logging.log4j.core.config.xml.XmlConfigurationFactory.getConfiguration(XmlConfigurationFactory.java:46)
	at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:525)
	at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:500)
	at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:424)
	at org.apache.logging.log4j.core.config.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:325)
	at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:690)
	at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:711)
	at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:253)
	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
	at org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
	at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:137)
	at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:55)
	at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:47)
	at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:33)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
	at org.apache.bookkeeper.tools.cli.BKCtl.<clinit>(BKCtl.java:32)
ERROR StatusLogger No logging configuration

Expected behavior

Logging should be working fine.

Screenshots

n/a

Additional context
The problem is related to wrong xml configuration. When deleting an extra </Console> and extra </Logger> from the xml, the command seems to work fine:

/opt/bookkeeper # bin/bkctl bookies list
09:28:02,151 INFO  BookKeeper metadata driver manager initialized
09:28:02,166 INFO  Initialize zookeeper metadata driver at metadata service uri zk://zookeeper-client:2181/pravega/pravega/bookkeeper/ledgers : zkServers = zookeeper-client:2181, ledgersRootPath = /pravega/pravega/bookkeeper/ledgers.
...
@shoothzj shoothzj self-assigned this May 30, 2022
@shoothzj
Copy link
Member

@RaulGracia In release 4.15.0? I can't reproduce the error using master code
image

@shoothzj
Copy link
Member

@RaulGracia I will close this issue first, feel free to reopen it

@lhotari
Copy link
Member

lhotari commented Feb 9, 2024

Fixed by #4137

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants