How to properly configure Log4J 2?

Hi,

I’m trying to configure Log4J2 in Java project after getting this message:

“No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'log4j2.debug' to show Log4j2 internal initialization logging.”

As I understood, I should add log4j2.properties to the classpath.

But, this file should also be located in Elastic’s config folder as mentioned here:

https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html#logging

Should I manage this file in two location? One location is Elastic node and the second one in my Java project?

I think I’m missing something here, your help will be highly appreciated.

Thanks

Are you using the TransportClient here?

May be read this: https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/_log4j_2_logger.html

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.