For Cas Config Server, where is the default log location?

13 views
Skip to first unread message

Joe Gullo

unread,
Jun 6, 2022, 12:59:21 PM6/6/22
to CAS Community
Running the config server, built from initializr, I'm getting this error in the log:  

2022-06-03 16:12:19,543 main ERROR Unable to create file casconfigserver.log java.io.IOException: Permission denied

For Cas and Cas Management Server, I can define an alternate log4j.xml and specify a ${basedir} which directs logs where I want them to go, but it appears that is not working for the config server, even if I bake it into the overlay.  Where is the default location for the log file for the config server supposed to go, I can't find a path defined in the documentation for this or spring config server?

Joe Gullo

unread,
Jun 6, 2022, 11:43:46 PM6/6/22
to CAS Community, Joe Gullo
I never figured out the desired default log location, but this worked for me to change the log location to /var/log/cas (a directory I made which is owned by tomcat):

1) Build the default overlay war (I've built it in /opt/cas/cas-configserver.orgname)
2) Copy "/opt/cas/cas-configserver.orgname/build/overlays/bootWar/cas/WEB-INF/classes/log4j2.xml" to "/opt/cas/cas-configserver.orgname/src/main/resources/log4j2.xml"
3) Edit the new file, changing the log location on lines "12 and 13":
3a) I changed  fileName="casconfigserver.log" to  fileName="/var/log/cas/casconfigserver.log" on line 12
3b) I changed  filePattern="cas-%d{yyyy-MM-dd-HH}-%i.log" to filePattern="/var/log/cas/cas-%d{yyyy-MM-dd-HH}-%i.log" on line 13
4) Rebuild the overlay war and run that.

Reply all
Reply to author
Forward
0 new messages