Do you have one log4j2.xml file or two? For testing purposes, I would put a single log4j2.xml file in WEB-INF/classes. That eliminates any possible properties file issues. Once you have the log4j2.xml file working correctly, then you can move it to your
logging.config location.
I ran into a problem finding out where, in my case, tomcat was writing logs. It wasn't writing them where I was expecting them. So I would also suggest hardcoding the path to the logs in your log4j2.xml configuration for now. Make it:
<RollingFile name="file" fileName="/opt/glassfish4/applicationFiles/cas/cas.log" append="true" filePattern="cas-%d{yyyy-MM-dd-HH}-%i.log">
Make sure that the user that Glassfish runs as can write to that folder. I should note that it is generally not recommended to write logs to the same place you have configuration files or on /opt for that matter. It would be too easy to delete an important file if you used a wildcard for the rm.
Patrick+