Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-3081

No factory method found for class org.apache.logging.log4j.layout.template.json.JsonTemplateLayout

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.14.1
    • None
    • JsonTemplateLayout
    • None

    Description

      We are using log4j2 in an uber-jar, so plugin initialization via Log4j2Plugins.dat is not possible.
      Using a programmatic Approach with

      PluginManager.addPackage("org.apache.logging.log4j.layout.template.json");

      we are getting the error

      java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.layout.template.json.JsonTemplateLayout
         at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findFactoryMethod(PluginBuilder.java:234)
         at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:134)

      Logging at the source code, a Method with @PluginFactory-annotation is missing.

      @PluginFactorypublic static JsonTemplateLayout createLayout(…)

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            vy Volkan Yazici
            fprumbau Frank Prumbaum
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment