I need to change my log4j properties (rootLogger, MaxFileSize, etc.) at runtime. How can I do this?
Use LogManager.resetConfiguration(); to clear the current config and configure it again.
Another approach is to build a new appender and replace the old one with it (most appenders don't support changing their config). This way, all the loggers (and their levels, etc) stay intact.
For this to work, I usually add the first appender from code (and not with a config file). That allows me to save a reference which makes it more simple to remove it later.