Re: org.apache.logging.log4j.core.config.Configurator.initialize(String, String)

2017-04-12 Thread Remko Popma
It may be good if we add more status logs during initialization for all the locations where we currently try to find the config file. I remember that log4j-web prints all locations. A more compact version of that may be useful. Config file not found is a common theme with Log4j2 on StackOverflow..

Re: org.apache.logging.log4j.core.config.Configurator.initialize(String, String)

2017-04-12 Thread Gary Gregory
I wonder how tricky such a refactoring would be. I could also imagine an enum listing all possible config locations and an API that takes an enum var arg for where to look. The default would be look everywhere. We getting out in left field WRT logging here... but it is still important IMO. Gary

Re: org.apache.logging.log4j.core.config.Configurator.initialize(String, String)

2017-04-12 Thread Remko Popma
The javadoc doesn't tell the full story here, which is that the current method searches the classpath next if the specified file doesn't exist. I guess it returns null after exhausting all options. Gary wants a way to stop in the middle. Sent from my iPhone > On Apr 12, 2017, at 17:53, Mikae

Re: org.apache.logging.log4j.core.config.Configurator.initialize(String, String)

2017-04-12 Thread Mikael Ståldal
Given that the Javadoc since 1,5 years ago says: @return The LoggerContext or null if an error occurred (check the status logger) I think it would be fine to return null if the given file is not found. On Wed, Apr 12, 2017 at 10:40 AM, Gary Gregory wrote: > On Wed, Apr 12, 2017 at 1:31 AM, Rem

Re: org.apache.logging.log4j.core.config.Configurator.initialize(String, String)

2017-04-12 Thread Gary Gregory
On Wed, Apr 12, 2017 at 1:31 AM, Remko Popma wrote: > I'd avoid changing the semantics of existing methods. I also favor 3. > (initializeStrict?) > Not a great method name but I am hard-pressed to come up with a better name: - initializeStrict - initializeChecked - initializeValidate - initial

Re: org.apache.logging.log4j.core.config.Configurator.initialize(String, String)

2017-04-12 Thread Remko Popma
I'd avoid changing the semantics of existing methods. I also favor 3. (initializeStrict?) Sent from my iPhone > On Apr 12, 2017, at 15:00, Matt Sicker wrote: > > This is a nice showcase for an Either data type similar to Optional, but > with a value or an error. > >> On 12 April 2017 at 00:4

Fwd: org.apache.logging.log4j.core.config.Configurator.initialize(String, String)

2017-04-11 Thread Matt Sicker
This is a nice showcase for an Either data type similar to Optional, but with a value or an error. On 12 April 2017 at 00:41, Gary Gregory wrote: > The problem with the API as it is now is that I have no idea if the API > did what I asked it to do. It does initialize log4j all right but not in a