logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: Failing to initialize log4j2 configuration dynamically
Date Sun, 18 Jun 2017 16:14:26 GMT
I think there is a Jira ticket already about this, if not, do create one
please. Are you available to create a failing unit test? A patch for a fix
as well perhaps?

Gary

On Jun 18, 2017 3:00 AM, "Roman Sosnin" <ROMANSO@il.ibm.com> wrote:

> Failing to initialize log4j2 configuration dynamically - supplying a JSON
> configuration node while json nodes are in random order.
>
> Environment: Linux - CentOS 6
> Component/s: Configurators
> Affects Version/s: 2.8.1
>
> For example, this one works for me:
> "configuration":
> { "status":"...", "name":"...", "properties":"...", "appenders":"...",
> "loggers":"..." }
> But this one fails:
> "configuration":
> { "status":"...", "name":"...", "appenders":"...", "loggers":"...",
> "properties":"..." }
> PAY ATTENTION: "properties" node is the last node and not 3rd.
> Initializing the config programmatically this way:
> JsonNode logObject =
> ConfigManager.getInstance().getContainerDefinition().at(
> CONFIG_LOGGING_JAVA_NODE);
> InputStream stream = new
> ByteArrayInputStream(logObject.toString().getBytes());
> ConfigurationSource source = new ConfigurationSource(stream);
> Configuration ourConfig = new
> JsonConfiguration(LoggerContext.getContext(), source);
> Configurator.initialize(ourConfig);
> where logObject is the actual log4j2 JSON config node.
> Any thoughts? Bug? API Misuse?
>
> Thanks!
>
> Regards,
> Roman Sosnin
> Backend Server Side Developer
> Trusteer Security
> IBM Israel Software Lab
> Office: +972-(0)74-7922783
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message