Logging

From jVantage

Jump to: navigation, search

jVantage utilizes log4j for all of its logging. Log files are an important aspect of the jVantage platform because they keep a running history of everything jVantage does as it processes user requests. This information is relevant to jVantage itself, and to the applications built using jVantage. During installation, the jVantage setup program automatically generates a configuration file that controls where and how long files are written, called jVantageLog.properties. By default, all log files are written to a directory called logs underneath the configuration directory. After the configuration file is initially created, log file configurations can be modified so that the logs themselves are written to other places in your file system, however, it is recommended that the log files always be written to the logs subdirectory under the configuration directory.

To take full advantage of the logging capabilities that jVantage has to offer, it is recommended that you become familiar with the log4j library. Information can be found a http://logging.apache.org/log4j.

The text below is a fragment from the log configuration file. It indicates that the ACL log file will be written to the directory C:/jvantage/logs/ACL.log and that the verbosity level is set at DEBUG. It also uses the DailyRollingFileAppender, which means the log files are automatically broken into individual files that correspond to each calendar day. This keeps log files from growing too large, and makes them easier to manage.

 #===================================================================#
 #  com.jvantage.ACL
 #===================================================================#
 log4j.logger.com.jvantage.ACL=DEBUG, JV1

 log4j.appender.JV1=org.apache.log4j.DailyRollingFileAppender
 log4j.appender.JV1.File=C:/jvantage/logs/ACL.log
 log4j.appender.JV1.layout=org.apache.log4j.PatternLayout
 log4j.appender.JV1.layout.ConversionPattern=%d{yyyy/MM/d HH:mm:ss} %-5p: %m%n

Feel free to modify these logs to suit your needs. The way that jVantage integrates session management and logging together is very powerful. Depending on the verbosity levels set in the log configuration file, it is possible to tie each user mouse click to zero or more log file entries. In fact, jVantage integrates session management and log handling to such a degree that at any point while jVantage is running and processing requests it is possible to see all the activity that the user it is engaged in by cross-referencing the session viewer, log files, and the user session Ids. The text below is part of a log file that was generated by jVantage. This fragment comes from the Servlet_Main.log file. This is one of many log files of jVantage generates as it runs. The beginning of each line shows the date and time of the log entry. The following word is the log level. Be aware that if the verbosity level for a given log is set to, for instance, DEBUG, it is still possible for log entries having different log levels to appear in your log file. The fragment below contains log entries for the DEBUG and INFO log levels. SID stands for session ID and TRX stands for transaction. When a user logs in to any jVantage application, he or she is assigned a unique number that is their session ID. This number remains the same for that user until he or she logs out. This number can be used to view session information using the session viewer. This means that at any time, your jVantage administrators can peer into the session of any logged in user to see information that is relevant to that user's online experience. Furthermore, the number can be cross-referenced with log files for a complete history of each user's activities. A transaction (TRX) usually corresponds to a user mouse click. Although the log fragment below comes from only one log file, the Servlet_Main.log, the session ID and transaction numbers can be used to search across multiple log files to find all relevant information about a given transaction as they were carried out in each of the many jVantage service components.

2005/09/5 14:30:48 DEBUG: SID(1146258) TRX(10000030) Processing request [controller?__jv_i=4&__jv_t=ACLGROUP&__jv_vt=ViewRecord]
2005/09/5 14:30:48 DEBUG: SID(1146258) TRX(10000030)      With triggers [controller?__jv_i=4&__jv_t=ACLGROUP&__jv_an=ACL&__jv_trx=10000030&__jv_vt=ViewRecord]
2005/09/5 14:30:48 DEBUG: SID(1146258) TRX(10000030) Current application name [ACL].
2005/09/5 14:30:49 DEBUG: SID(1146258) TRX(10000030) Retrieving Velocity context from PageBuilder...
2005/09/5 14:30:49 DEBUG: SID(1146258) TRX(10000030) Merging template...
2005/09/5 14:30:49 INFO : SID(1146258) TRX(10000030) Using UI Theme [jvtheme-jvantage] for application name [ACL].
2005/09/5 14:30:49 INFO : SID(1146258) TRX(10000030) User Interface template source URL [http://localhost/]
2005/09/5 14:30:49 DEBUG: SID(1146258) TRX(10000030) Attempting to fetch default template for table context [ACLGROUP] viewType [ViewRecord].
2005/09/5 14:30:49 DEBUG: SID(1146258) TRX(10000030) Preparing to fetch templateName [http://localhost/jvtheme-jvantage/acl/aclgroup_viewrecord.html]
2005/09/5 14:30:49 DEBUG: SID(1146258) TRX(10000030) Attempting to fetch default template name for viewType [ViewRecord].
2005/09/5 14:30:49 DEBUG: SID(1146258) TRX(10000030) Template name for ViewType [ViewRecord] is [http://localhost/jvtheme-jvantage/defaultviewrecord.html].
2005/09/5 14:30:49 INFO : SID(1146258) TRX(10000030) (T) Time to successfully process request [0:00:00.451].
2005/09/5 14:30:51 DEBUG: SID(1146258) TRX(10000031) Processing request [controller?__jv_i=8160&__jv_t=APPLICATIONS&__jv_vt=ViewRecord]
2005/09/5 14:30:51 DEBUG: SID(1146258) TRX(10000031)      With triggers [controller?__jv_m=contextViewApplication&__jv_l=AppTables&__jv_vt=SnapIn&__jv_trx=10000031&__jv_uvt=ViewRecord&__jv_sit=sit1&__jv_i=8160&__jv_jt=TableAttrs&__jv_jndi=ejb/jvantage/ApplicationViewRecordSnapIn&__jv_an=jVantage&__jv_t=APPLICATIONS&__jv_jf=application]
2005/09/5 14:30:51 DEBUG: SID(1146258) TRX(10000031) Current application name [jVantage].
2005/09/5 14:30:52 DEBUG: SID(1146258) TRX(10000031) Retrieving Velocity context from PageBuilder...
2005/09/5 14:30:52 DEBUG: SID(1146258) TRX(10000031) Merging template...
2005/09/5 14:30:52 INFO : SID(1146258) TRX(10000031) Using UI Theme [jvtheme-jvantage] for application name [jVantage].
2005/09/5 14:30:52 INFO : SID(1146258) TRX(10000031) User Interface template source URL [http://localhost/]
2005/09/5 14:30:52 DEBUG: SID(1146258) TRX(10000031) Using usurped ViewType [ViewRecord]
2005/09/5 14:30:52 DEBUG: SID(1146258) TRX(10000031) Attempting to fetch default template for table context [APPLICATIONS] viewType [ViewRecord].
2005/09/5 14:30:52 DEBUG: SID(1146258) TRX(10000031) Preparing to fetch templateName [http://localhost/jvtheme-jvantage/jvantage/applications_viewrecord.html]
2005/09/5 14:30:52 INFO : SID(1146258) TRX(10000031) (T) Time to successfully process request [0:00:00.501].

If you would like to reduce the number of log files that are generated, it is possible to reconfigure the log configuration file and combine the output from different logs to the same physical file. Again, these are advanced features that you should acquaint yourself with if you plan to modify the default logging behavior jVantage.

Personal tools