In my default cstr i an instantiating my log4j logger wherein i want to send in log file dir path during run time.
My default cstr has this:
logger = new LoggerSetup().SetLogger(Logger.getLogger(ServiceController.class), "FileLogger", LogDirPath); I have the path set in my properties file and i read that via
@Value("#{settings['ApplicationLogDirPath']}") private String LogDirPath; However as the cstr gets called before the @Value is wired up, the LogDirPath in the cstr is always null.
Is there another annotation that I should use else is there a better way?
What I am trying to achieve is to set the log4j log path set dynamically from log file in addition my controller has need for 2 loggers so that application level logs are logged to one spot and a long running database call [ controller calls biz layer ] writes to another location. the controller logs before calling the biz layer and then once the biz layer returns it logs that and hence 2 different log files. Customer needs this bizare logging so it is what it is
-DlogPath=<path>