Given a JSON snippet for configuring a layout, how can I instantiate the
layout class itself? I have tried the following, which "runs" without a
failure, but couldn't access to a layout:

LoggerContext context = (LoggerContext) LogManager.getContext();
ConfigurationSource configSource =
        new ConfigurationSource(
                new ByteArrayInputStream(
                        ("{'PatternLayout': {'MarkerPatternSelector': {" +
                                "'defaultPattern': '%m%n', " +
                                "'PatternMatch': {'key': 'FLOW',
'pattern': '===%m===%n'}" +
                                "}}}")
                                .replaceAll("'", "\"")
                                .getBytes(StandardCharsets.UTF_8)));
JsonConfiguration configuration = new JsonConfiguration(context, configSource);

Eventually I want to obtain a Layout<?> instance. Any ideas?

Reply via email to