How does CAS load log4j2.xml based on cas.properties

12 views
Skip to first unread message

Yan Zhou

unread,
Sep 20, 2018, 9:41:29 AM9/20/18
to CAS Community
Hello!

I wish to figure out how CAS 5.x loads an externalized log4j2.xml based on the setting in cas.properties.

logging.config=file:///... some location... /config/log4j2.xml

As far as Spring doc., it says:  An ApplicationContextInitializer that configures a logging framework depending on what it finds on the classpath and in the Environment. If the environment contains a property logging.config then that will be used to initialize the logging system, otherwise a default location is used. 

This is why, when I tries to use the same approach for my web application (NOT related to CAS). it does not work.  the externalized log4j2.xml is not loaded because it is not in classpath, nor is it specified in an environment property. 

I deploy multiple web apps (Spring Boot apps) on the same host, each Web app has its own Log4j2.xml file, so I want to find a approach that is specific to the app., not a global one.

Thx!
Yan
Reply all
Reply to author
Forward
0 new messages