I am new to log4j and need help understanding things about the logger instance. I define a logger in my class as a static member
public static Logger myLogger = Logger.getLogger(MyClass.class.getName());
A static member gets loaded into the memory when the class is loaded in memory by the JVM. If I am deploying my application as web service I am assuming the class will stay in the memory till the application is running. So that every time a request comes in , the application can immediately process it.
If i am using FileAppender or a JDBCAppender , would the file or database resources also be open throughout the life of the application.
Or does the log4j framework under the hood handle these resources differently/smartly.
If not , are there any guidelines / best practices for gracefully handling these resources when using log4j?