I want to output my variable to a file, and I need to use log4j framework.
I wrote the following code but it seems it has no effect since the file is empty. (I created the file manually, not with the code).
Logger logger = Logger.getLogger("com.foo");
FileAppender fa = new FileAppender();
I also find an elegant way with,
but I don't know where to put this properties code. Should I put it into my java source code or create a file and map it? (if so, how?), what should I do?
P.S. it's not a web project but a simple java code with no main class to produce Jar (so I cannot output it to console).