Αναφορά Προβλημάτων και Δημιουργία DEBUG Logs


Added by Spyros Papadakis, last edited by Spyros Papadakis on Sep 16, 2008

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
Unknown macro: {snipedit}

Αναφορά προβλημάτων

Εάν προσπαθείτε να εκθέσετε ένα πρόβλημα στο  LAMS ή το RAM στην Κοινότητα LAMS, σας παρακαλούμε δώστε 5 λεπτά για να διαβάσετε αυτές τις οδηγίες. Φαίνονται πολλά, αλλά είναι μόνο βήμα προς βήμα  οδηγίες έτσι ώστε να μην είναι και τόσο κακές.

Λίγες περισσότερες λεπτομέρειες που εσείς μπορείτε να μας δώσετε για το πρόβλημα είναι ο γρηγορότερος για να σας προτείνουμε μια λύση.

  • Παρακαλώ μας πείτε μας τα εξής:
    • ποια έκδοση LAMS τρέχετε (LAMS 2.0, 2.0.2, κ.λπ.)
    • εάν χρησιμοποιείτε Moodle, Sakai ή κάποιο άλλο LMS που ενσωματώνονται με σε LAMS έπειτα το όνομα και την έκδοση του LMS
    • ποιο λειτουργικό σύστημα  χρησιμοποιείτε (Windows, Linux, κ.λπ.).
  • Εάν το πρόβλημα είναι με το σχεδιάγραμμα στην οθόνη, ή την κακή οθόνη διατύπωσης ή κάτι άλλων σχετική (π.χ. LAMS διαμορφώνεται για να τρέξει στα ελληνικά, αλλά η μισή από την οθόνη εμφανίζεται στα αγγλικά ή ένα λάθος Javascript εμφανίζεται σταματώντας τη φόρτωση οθόνης), κατόπιν μπορείτε εσείς παρακαλώ:
    • Επισυνάψτε μια οθόνης με κάποιο πρόβλημα. Έτσι θα ξέρουμε ακριβώς για το θέμα που μας μιλάτε.
    • Πείτε μας ποιά μηχανή αναζήτησης χρησιμοποιείτε και την έκδοση της (Firefox 3.0, IE. 7.0, κ.λπ.).
    • Πείτε μας ποιά έκδοση του Flash έχετε εγκαταστήσει. Για να βρείτε την έκδοση του Flashφορέα λάμψης, πηγαίνεte στη μηχανή αναζήτησης στην οποία εμφανίστηκε το πρόβλημα και πηγαίνετε στο http://www.macromedia.com/software/flash/about/. 
  • Εάν παίρνετε ένα «φρικτό» λάθος όπως τον ακόλουθο, παρακαλώ βάλτε τις πρώτες-πρώτες γραμμές του λάθους στο μήνυμά σας, and then attach the LAMS/RAMS server logs. If you have time to create the DEBUG version of the logs, then that will give us extra details. See "Creating the DEBUG Logs" below for how to create the logs. If you don't have time to create the DEBUG version, or you can't reproduce the problem, please send us the log files that already exist (see "Which Files To Send?") as the complete error is normally written to the logs. Put the logs in a zip file and attach them to the post. @import url(/download/resources/confluence.ext.code:code/shStyles.css);| Fail to fetch user data from external server:sakai - Unexpected return HTTP Status:401 |
    org.lamsfoundation.lams.integration.UserInfoFetchException: Fail to fetch user data from external server:sakai - Unexpected return HTTP Status:401
    at org.lamsfoundation.lams.integration.service.IntegrationService.getUserDataFromExtServer(IntegrationService.java:239)
    at org.lamsfoundation.lams.integration.service.IntegrationService.createExtUserUseridMap(IntegrationService.java:177)
    at org.lamsfoundation.lams.integration.service.IntegrationService.getExtUserUseridMap(IntegrationService.java:130)
    at org.lamsfoundation.lams.integration.service.IntegrationService$$FastClassByCGLIB$$24924e31.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:6 Fail
    to fetch user data from external server:sakai - Unexpected return HTTP
    Status:401
    org.lamsfoundation.lams.integration.UserInfoFetchException: Fail to
    fetch user data from external server:sakai - Unexpected return HTTP
    Status:401
    at
    org.lamsfoundation.lams.integration.service.IntegrationService.getUserDataFromExtServer(IntegrationService.java:239)
    at
    org.lamsfoundation.lams.integration.service.IntegrationService.createExtUserUseridMap(IntegrationService.java:177)
    at
    org.lamsfoundation.lams.integration.service.IntegrationService.getExtUserUseridMap(IntegrationService.java:130)
    at
    org.lamsfoundation.lams.integration.service.IntegrationService$$FastClassByCGLIB$$24924e31.invoke(<generated>)
    at
    net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at
    org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:6if(!window.newcodemacro_initialised) { window.newcodemacro_initialised = true; window.oldonloadmethod = window.onload; window.onload = function()
    Unknown macro: { dp.SyntaxHighlighter.HighlightAll('newcodemacro'); if(window.oldonloadmethod)
    Unknown macro: { window.oldonloadmethod(); }
    }
    }
    Do not try to paste large bits of text from the logs straight into a message on the community website. This sometimes causes the server to have problems, and the LAMS teams won't get a email to say you have left a message on the community. So it will take longer for us to realise that you have a problem!

Attaching More Than One File To A Post

When you post a message on the LAMS (or RAMS) Community, there is an option "Attach?" at the bottom of the page. Select  "Yes" and then when you click "Post" it will ask you attach the file.

But what if you want to attach more than one file? The trick is to click "Post" and upload one file as usual. When you get to the screen after the attachment screen (ie once the file is uploaded), click the backbutton in your browser and you will go back to the upload screen. You should be able to upload another file. You can keep attaching and hitting back multiple times.

Creating the DEBUG Logs

Turning On DEBUG

When you run the installer, the logging level is automatically set to INFO. To change the level of logging, do the following:

  • Log onto the computer running LAMS and go to the directory <jboss>/server/default/conf/
  • Copy the file log4j.xml to log4j.xml.original
  • Edit the file log4j.xml. This is an XML file, but it can be edited in any text editor, such as Notepad.
  • Find the following entry and change the "INFO" to "DEBUG":

Original entry:<appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File" value="$

Unknown macro: {jboss.server.home.dir}

/log/server.log"/>
<param name="Append" value="false"/>
<param name="Threshold" value="INFO"/> <--- Change this line
....
</layout>
</appender>

New entry:<appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File" value="$

/log/server.log"/>
<param name="Append" value="false"/>
<param name="Threshold" value="DEBUG"/>
....
</layout>
</appender>

  • Find the following entry and change the "INFO" to "DEBUG"

Original entry:<category name="org.lamsfoundation.lams" additivity="false">
<priority value="INFO"/> <--- Change this line
<appender-ref ref="LAMSFILE"/>
<appender-ref ref="LAMSCONSOLE"/>
</category>

New entry:<category name="org.lamsfoundation.lams" additivity="false">
<priority value="DEBUG"/>
<appender-ref ref="LAMSFILE"/>
<appender-ref ref="LAMSCONSOLE"/>
</category>

  • If LAMS is already running, then stop and restart LAMS or wait about 15 minutes. LAMS will pick up the change automatically after sometime but we can't tell you exactly how long to wait. So if you want to know that the change completed and create your log files, then stopping and restarting LAMS will make it update immediately. But if it is inconvenient to restart LAMS (as classes are running using LAMS) then if you wait for a while the change will take affect.

How do you know if the change has worked? Have a look at the file <jboss>/server/default/log/lams.log. If you see entries with the word "DEBUG" in the third column, then the change has worked and the debugging messages are being written to the log.

For example:14:57:01,515 [http-0.0.0.0-8080-3:] DEBUG org.lamsfoundation.lams.integration.security.SingleSignOn - Process request for '/lams/index.jsp'
14:57:01,515 [http-0.0.0.0-8080-3:] DEBUG org.lamsfoundation.lams.integration.security.SingleSignOn - Checking for SSO cookie
14:57:01,515 [http-0.0.0.0-8080-3:] DEBUG org.lamsfoundation.lams.web.filter.LocaleFilter - Locale set from server is en,AU

Which Files To Send?

Once debugging is turned on, please make the problem happen again. ie do whatever it was you have reported as a problem. Then go back to the <jboss>/server/default/log/ and then send us all the files in that directory that have been changed today. This should include the following files:

  • audit.log.<today's date>
  • server.log
  • hibernatelams.log and maybe hibernatelams.log.<some number>
  • lams.log and maybe lams.log.<some number>
  • localhost_access_log.<today's date>.log

Why maybe lams.log.<some number> and hibernatelams.log.<some number>? If these logs get very long, then they start another log file and make the old one .1, .2, etc. That's why we only want today's files - the maybe a hibernatelams.log.7 still there from three weeks ago and that won't be any help. But a hibernatelams.log.1 that was created today may be helpful to sort out the problem.

If the problem relates to the Moodle integration then include Moodle's Apache log (from the Apache directory).

Please zip up the log files before sending as they can be very big.

Turning Off DEBUG

Once you have created the logs and posted them on the LAMS/RAMS Community, or emailed them to whoever is doing your support, then you want to turn off the debugging again as it can slow down your LAMS server. If this is a bug that is difficult to reproduce, you can leave it in DEBUG mode until you have been able to reproduce the problem but on a large production system  you should not run in DEBUG for any longer than you have to.

To put it back to the original settings:

  • Log onto the computer running LAMS and go to the directory <jboss>/server/default/conf/
  • Copy the file log4j.xml to log4j.xml.debug. If you keep the debug version then you will have it ready for next time.
  • Copy the file log4j.xml.original to log4j.xml. (You should have created the log4j.xml.original file when you changed the server to DEBUG level).
  • Either restart your LAMS server or just let LAMS pick up the changes automatically in the next ten minutes or so.