CAS is not saving cas.log

19 views
Skip to first unread message

carlos maddaleno cuellar

unread,
Oct 13, 2016, 10:21:27 AM10/13/16
to CAS Community
Hi good morning i wanted to know if someone can help me my cas is not creating cas.log on the WEB-INF/classes

so my configuration on log4j2.xml is this

- <RollingFile name="file" fileName="log/cas.log" append="true" filePattern="cas-%d{yyyy-MM-dd-HH}-%i.log">
  <PatternLayout pattern="%d %p [%c] - %m%n" />
- <Policies>
  <OnStartupTriggeringPolicy />
  <SizeBasedTriggeringPolicy size="10 MB" />
  <TimeBasedTriggeringPolicy />
  </Policies>
  </RollingFile>

and my cas properties i have this properties configuration
log4j.config.location=file:/opt/glassfish4/applicationFiles/cas/log4j2.xml
logging.config=file:/opt/glassfish4/applicationFiles/cas/log4j2.xml

but when i go to the path
WEB-INF/classes i have another log4j2.xml and the cas.log is not anywhere how can i configure to generate the log file to the same path for the log4j2.xml

like this

/opt/glassfish4/applicationFiles/cas/cas.log

thanks



Patrick Gardella

unread,
Oct 13, 2016, 11:51:57 AM10/13/16
to carlos maddaleno cuellar, CAS Community
You didn't mention what version of CAS you are using. If you are on the 4.2 builds, look here for details: https://apereo.github.io/cas/4.2.x/installation/Logging.html

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">

If that works, you can leave it, or you can try to find out where Glassfish thinks it is writing them.  I found this: http://stackoverflow.com/questions/13835913/location-of-glassfish-server-logs which might help.  

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+

--
CAS gitter chatroom: https://gitter.im/apereo/cas
CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
CAS documentation website: https://apereo.github.io/cas
CAS project website: https://github.com/apereo/cas
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To post to this group, send email to cas-...@apereo.org.
Visit this group at https://groups.google.com/a/apereo.org/group/cas-user/.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/CANEG9%2BdpXANFb1gBP9g1Z68JM2qGeZtoBp%3DKtdAczVNUjjvo%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/a/apereo.org/d/optout.

Reply all
Reply to author
Forward
0 new messages