Johnny Lim
Johnny Lim

Reputation: 5843

How to exclude a specific log4j default configuration file?

I have a project which depends on hadoop-core.

hadoop-core has its own log4j configuration.

The default log4j configuration is loaded in my project.

I want my project not to be affected by it.

How do I solve this?

Upvotes: 1

Views: 300

Answers (1)

FrVaBe
FrVaBe

Reputation: 49341

If you do not want the hadoop-core provided log4j configuration to be the one used by log4j you have to provide another configuration file that should be used.

You should have a look at the log4j manual. The section "Default Initialization Procedure" describes how log4j will try to find the initialization file and explains possibilities to match a special configuration (e.g. by setting the system property log4j.configuration).

Upvotes: 1

Related Questions