[ 
https://issues.apache.org/jira/browse/LOG4J2-3267?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ralph Goers reopened LOG4J2-3267:
---------------------------------

Reopening as the change had to be reverted. It was causing the build to fail.

Making the method public doesn't work because it takes a parameter of type Type 
which is also package private. I am not sure exposing that is a good idea. 
Perhaps it would be better to create public methods that hard-code the Type. So
{code:java}
public void generateCustom(final String[] args, final PrintStream printStream) {
    generateCustom(args, Type.Custom, printStream);
}{code}

> Getting public access to 
> org.apache.logging.log4j.core.tools.Generate#generate method for automated 
> code generation
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-3267
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3267
>             Project: Log4j 2
>          Issue Type: Wish
>          Components: Core
>    Affects Versions: 2.17.0
>            Reporter: Gotthard Witsch
>            Assignee: Remko Popma
>            Priority: Trivial
>             Fix For: 2.17.2
>
>
> 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)|https://logging.apache.org/log4j/2.x/manual/customloglevels.html#CustomLoggers]
> 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.
> {code:java}
> static void generate(final String[] args, final Type type, final PrintStream 
> printStream) {code}
> Is there any chance of changing this? Or what was the intention to keep it 
> package-private?



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to