I use log4j to enter my project. Here is an example setup:
public class MyClass {
private final Logger logger = Logger.getLogger(MyClass.class);
public MyClass() {
BasicConfigurator.configure();
Logger.getLogger(MyClass.class).setLevel(Level.INFO);
}
...
}
The problem is that with each next call to the log it duplicates the log messages (I mean that on the first call there is only one message, on the second call there are two identical messages, then there are 3 of them, etc.). It seems that every time a new journal instance is created and used with all old instances.
How to avoid this problem? Thank.
SCP Tried to make it static, but it still doesn't work. I still get some log messages. Any ideas? Probably some specific Weblogic stuff?