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

Getting public access to org.apache.logging.log4j.core.tools.Generate#generate method for automated code generation

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.17.0
    • 2.17.2
    • Core
    • None

    Description

      Hi devs,

      I'd like to automate the creation of a custom logger with gradle.

      Sticking to the documentation i've tried to use org.apache.logging.log4j.core.tools.ExtendedLoggerGenerator as mentioned in Log4j – Custom Log Levels (apache.org)

      Unfortunately the output can only be consumed from console, making it very hard for automation.

      Investigating the implemenation led me to org.apache.logging.log4j.core.tools.Generate.generate.

      Unfortunately the required method is package private.

      Therefore it would be helpful to change the generate-method's visibility to public to gain access in gradle scripts.

      static void generate(final String[] args, final Type type, final PrintStream printStream) 

      Is there any chance of changing this? Or what was the intention to keep it package-private?

      Attachments

        Activity

          People

            rpopma Remko Popma
            gotthard_w Gotthard Witsch
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: