Can your question be rephrased as:
How do I set two different log levels using properties files for log4j - using two separate files for two classes in different packages?
If this is the case, rimero's answer is a start. But instead of dropping the properties files in src/main/sources, you need to drop each file (defining a different log level) in a directory structure reflecting the package name (for example src/main/projectname/page). Then, you can load each properties file separately using
PropertyConfigurator.configure(URL configURL)
There are a couple of ways to get the url of your properties files, see for example:
How to configure log4j with a properties file
Here is a full example:
public class TestPropertiesFile {
private static final String PREFIX = "projectname/pages";
private static final org.apache.log4j.Logger LOGGER = org.apache.log4j.Logger
.getLogger("projectname.page.SomeClass");
private static String PROPERTIES_PATH;
static {
PROPERTIES_PATH = Thread.currentThread().getContextClassLoader()
.getResource(PREFIX + "/log4j.properties").getPath();
org.apache.log4j.PropertyConfigurator.configure(PROPERTIES_PATH);
}
public static void test() {
LOGGER.info("Logging from: " + PROPERTIES_PATH);
}
}