Monitoring Applications
COGNITUM Engine Monitoring Logs
Applications made with COGNITUM are secure applications. The administrator can monitor the application server where a COGNITUM application is developed or deployed.
Logs are available to watch how the server and the applications work:
- Access logs
- Error logs
Access Logs
Actions accesses are logged-in identified files. On the development server, the COGNITUM Console makes it possible to configure action logs. The log files are automatically and incrementally generated according to a predefined size or time frame.
By default, actions accesses are recorded in the accesslog.log file in the COGNITUM-root/Server/logs/application/ folder.
COGNITUM development server access logs
The access logs available in the COGNITUM Console are used to set up analytical reports on each operation from COGNITUM applications onto directories. The logs list all the data queries and give an archived report of the results.
Viewing the COGNITUM access logs
Events in the access logs can be viewed selectively. The length and detail of the logs can be easily customized.
COGNITUM lets you view the access operations in the COGNITUM Console when the Access Log item is selected below the Logs item for the corresponding application.
Figure: COGNITUM access logs panel
Number of Lines to Analyze: It is the number of events that are taken into account when reporting the information. The maximum number of lines is 5000, requiring an average 40-second loading and producing an average 1 MB log file.
Action to Display: The drop-down box gives access to display filters on event types. By default, the General display mode is selected.
Table: Actions (part 1 of 4)
Action to Display | Information recorded |
---|---|
General | Result of the login attempt: success, pending or failure ■ Date ■ Type of action ■ Name of the user logged in ■ Selected application ■ Duration in milliseconds |
Table: Actions (part 2 of 4)
Action to Display | Information recorded |
---|---|
Web Service | Each time a Web service is called by an application ■ Date ■ SERVICE action ■ Name of the user logged in ■ Related application ■ Duration in milliseconds ■ Called Web service ■ Triggered function |
Edit | Each time an attribute is modified. ■ Result: success, pending or failure ■ Date ■ EDIT action ■ Name of the user logged in ■ Selected application ■ Duration in milliseconds ■ Request DN When the Log Attributes values for Create and Edit actions option has been selected in the Access tab, the Attribute cell can be clicked to open a dialog box. The two-column table displays the attributes modified and their values. |
Create | Whenever a new resource is created. ■ Result: success, pending or failure ■ Date ■ CREATE action ■ Name of the user logged in ■ Selected application ■ Duration in milliseconds ■ Request DN When the Log Attributes values for Create and Edit actions option has been selected in the Access tab, the Attribute cell can be clicked to open a dialog box. The two-column table displays the attributes created and their values. |
Delete | Whenever a resource is deleted. ■ Result: success, pending or failure ■ Date ■ DELETE action ■ Name of the user logged in ■ Selected application ■ Duration in milliseconds ■ Request DN |
Table: Actions (part 3 of 4)
Action to Display | Information recorded |
---|---|
Login | Result of the login attempt: success, pending or failure ■ Date ■ LOGIN action ■ Name of the user logged in ■ Selected application ■ Duration in milliseconds |
Logout | Result of the logout attempt: success, pending or failure ■ Date ■ LOGOUT action ■ Name of the user logging out ■ Selected application ■ Duration in milliseconds |
Disconnect | Result: success, pending or failure ■ Date ■ DISCONNECT action ■ Name of the user disconnecting ■ Selected application ■ Duration in milliseconds |
Request | Each time the user requests access to an application, view, or resource, or performs a search. ■ Result: success, pending or failure ■ Date ■ REQUEST action ■ Name of the user logged in ■ Selected application ■ Duration in milliseconds ■ Displayed view ■ Resource used ■ Request DN ■ Request scope ■ Results |
List | Each time a user displays a list of resources. ■ Result: success, pending or failure ■ Date ■ LIST action ■ Name of the user logged in ■ Selected application ■ Duration in milliseconds ■ Displayed view ■ Resource used ■ Request DN |
Table: Actions (part 4 of 4)
Action to Display | Information recorded |
---|---|
Custom | Any action generated by an application, as defined by the COGNITUM application designer with the CDMLogger method of the COGNITUM API. For more information, see <COGNITUM-root>\doc\baggage\javadoc\ apijavadoc\cdm\api\pub\CDMLogger.html. A number of custom actions can be configured in the same log, but they are recorded under the same CUSTOM label. ■ Date ■ CUSTOM action ■ Name of the user logged in ■ Selected application ■ Duration in milliseconds ■ Error code ■ Message ■ Result |
The log file display can be customized with the following list functions:
- Click the top of a column sorts the log file entries in increasing order according to the selected criteria. Shift-click the column to sort the entries in decreasing order.
- With a simple drag-and-drop operation, columns can swap positions in the table.
NOTE |
---|
In order to get a hard copy of the access logs, it is advised to display them through the Agent Web interface or directly from the access files in the COGNITUM-root/Server/logs folder. User-friendly versions of the access logs can be printed then. |
To view the access logs in the COGNITUM Console
- In the COGNITUM Console tree, select Logs, then Access Log under the corresponding application.
- In Number of Lines to Analyze, enter the number of events that you want to see in the table.
- Choose an action filter in Action to Display or leave the General display option.
Working with COGNITUM access logs
The physical log files of all recorded access operations can be displayed and printed. The log files are stored in the folder COGNITUM-root/Server/logs/application/
Figure: COGNITUM access logs file
The physical log files can be opened and printed with any text viewer, for example Notepad.
To view and print a COGNITUM access log file
- In your file explorer, open the COGNITUM-root/Server/logs/application/ folder.
- Select the accesslog.log file and open it with a text viewer, for example Notepad.
- In the viewer, choose File Print to print the logs content.
Configuring COGNITUM access logs
Accesses are selected and logged in identified files. Access log files can be created automatically and incrementally according to a predefined size or time frame. In the COGNITUM Console tree, a click on the Logs item below the corresponding application gives access to the Access tab.
Figure: COGNITUM access logs properties
Filename: It is the name of the file to which logs entries are written. According to the rotation mode, the file is renamed with the date or a numeric suffix. Log files are stored in the COGNITUM-root/Server/logs/application/ folder.
When the rotation by size or by date is selected, the file name entry serves as the root to name the access log files. For more information, see “Access log files size rotation” and “Access log files date rotation”.
Date Format: It is the way events are dated in the logs. Three date format options are available in the drop-down list: DATE, ABSOLUTE and ISO8601. When selected the date syntax is stated next to the selection box.
Actions to Log: One or more types of events can be recorded in the log file. One or more option boxes can be checked accordingly. For more information, see “Access actions selection”.
Log File Rotation: This area makes it possible to specify how log files are to be automatically built in sequence. Rotating access log files means that whenever certain criteria are satisfied, COGNITUM automatically closes the current log file and creates a new one, according to the specified option. Basically, the rotation options are:
- rotation by size of the log file, as documented in “Access log files size rotation”.
- rotation, as documented in “Access log files manual rotation”.
- rotation by date, as documented in “Access log files date rotation”.
- manual rotation, as documented in “Access log files manual rotation”.
To configure the access logs
- In the COGNITUM Console tree, under the corresponding application, select the Logs item.
- In the Access tab, populate the Filename box with the name of the access log file as you want it to appear in the COGNITUM-root/Server/logs/application/ folder.
- In the Date Format drop-down list, select the syntax you want event dates to be written in your logs.
- For the Actions to Log, check the options boxes standing for the types of events that should appear in your logs. For more information, see “Access actions selection”.
- In the Log File Rotation area, choose the rotation mode option box:
- Choose the By File Size option when you want the log file size to trigger the rotation. Populate the Maximum File Size with the MB limit when a new file is created. In Maximum Number of Files, enter the number of log files before a new one overwrites the older one. For more information, see “Access log files size rotation”.
- Choose the None option when you want to have a single log file or to create manual ones. For more information, see “Access log files manual rotation”.
- Choose the By Date option when you want a time limit to trigger the rotation. In Hour, select the time for the checked days when the access log file is rotated. For more information, see “Access log files date rotation”.
- Click Apply to save the access log file configuration.
Access actions selection
Actions can be selected in the File Contents area when configuring the access logs.
Figure: Access actions selection
An access log records the information corresponding to the selected actions: the action types can be changed and recorded accordingly.
Table: Access log actions
Actions to Log | Information recorded |
---|---|
Login | Result of the login attempt: success, pending or failure |
Logout | Result of the logout attempt (user action): success, pending or failure |
Disconnect | Result (when COGNITUM session has expired): success, pending or failure |
Custom | Any action generated by an application, as defined by the COGNITUM application designer with the CDMLogger class of the COGNITUM API. For more information, see <COGNITUM-root>\doc\baggage\javadoc\ apijavadoc\cdm\api\pub\CDMLogger.html. A number of custom actions can be configured in the same log, but they are recorded under the same CUSTOM label. |
Request | Each time the user requests access to an application, view, or resource, or performs a search. |
List | Each time a user displays a list of resources. |
Web Service | Each time a Web service is called by an application |
Edit | Each time an attribute is modified. The Log Attributes values for Create and Edit actions option makes it possible to log the modified attributes. |
Create | Whenever a new resource is created. The Log Attributes values for Create and Edit actions option makes it possible to log the attributes of the created entry. |
Delete | Whenever a resource is deleted. |
Access log files size rotation
Rotating log files with the By File Size option available in the Log File Rotation area is performed when a log file reaches a potential maximum size. This may be paired with a restriction on the number of log files. Administrators are then able to plan the disk space needed for the COGNITUM access log files.
Figure: Access log files size rotation
By File Size: This option must be selected to trigger the rotation operation when the specified size is reached.
Maximum File Size: It is the size in megabytes when the current log file is closed and a new one is created. It must be an integer.
Maximum Number of Files: It is the maximum number of access log files allowed. When the creation of a new log file would exceed this number, the older file is overwritten by the next one, and so on. When there should not be any restriction in the number of log files, the 999 entry is advised.
NOTE |
---|
Log files are numbered with numeric increments. For example, when five is the maximum number of log files, the current file may be named access_logs and the oldest one is access_logs.4 |
Access log files date rotation
Rotating log files with the By Date option available in the Log File Rotation area is performed each time the specified day and hour is reached.
Figure: Access log files date rotation
Hour: It is the time of the day when a log file containing one or more events is rotated. With the arrow buttons, the hour can be selected.
Mon/Tue/Wed/Thu/Fri/Sat/Sun: The day boxes must be checked when the rotation should occur.
Log files are named with a date suffix. For example, an access log file listing actions performed on the 18 December 2003 may be recorded as access_logs_18-12-2003
Log files rotation on dates does not imply weekly rotations, that is the number of date-related log files is unlimited. Log files are stored in the COGNITUM-root/Server/logs/application/ folder.
NOTE |
---|
As soon as an action is recorded before the next rotation date, the log file is rotated. For example, despite a 6 o’clock file creation configuration, no action after this hour shall produce any log file; But a logged event at 11:48 will trigger the day rotation. Rotation is performed only when it contains one or more events. If the date and hour fall due for an empty log file, there is no rotation. |
Access log files manual rotation
Rotating log files with the Rotate Now button is performed instantly. This may be paired with the size and date rotation modes.
NOTE |
---|
A manual rotation does not reset the rotation by file size or by date. Only the length of the access logs may impact the moment when the log file is created. |
Rotate Now: A click on the button displays a box prompting for a filename. The filename must be unique. The manual log file is stored in the COGNITUM-root/Server/logs/application/ folder
Figure: Access log files manual rotation
Production server access logs
The COGNITUM access logs are available when configured before the COGNITUM application is deployed on the application server. In the COGNITUM Console, the Export as WAR wizard makes it possible to specify the cdm.logs.home key for the path of the Web access logs. For more information, see “
Exporting an application for deployment
”.
The physical log files of all recorded access operations can be displayed and printed. The log files are stored in the folder defined by the cdm.logs.home key in the Export as WAR wizard.
Figure: Production server access logs file
The physical log files can be opened and printed with any text viewer, for example: Notepad.
To view and print a COGNITUM access log file
- In your file explorer, open the accesslog.log file in the folder defined at the WAR export.
- Open it with a text viewer, for example Notepad.
- In the viewer, choose File Print to print the logs content.
Application Logs
COGNITUM 7.8.00 brings the privilege to access the logs of application from the console with help of a feature View Logs over previous Calendra, CDM and COGNITUM versions.
ThisfeatureView logs is explained in the document Application with new Features and Improvements in COGNITUM 7.8.
Error Logs
Application servers generate errors logs as requested by applications. For a COGNITUM application, the logs list all the issues that the application cannot handle properly, like a wrong LDAP or SQL request or a data source failure.
The error logs are very useful, since they can help pinpoint and troubleshoot errors easily.
COGNITUM development server error logs
With an application server used in development mode, error logs are available as .txt files named by default application_log.YYYY-MM-DD.txt and available in the COGNITUM-root/Server/logs/application/ folder.
These files can be displayed and printed with any text viewer, for example Notepad.
To view and print an error log file on a COGNITUM application server
- In your file explorer, open the COGNITUM-root/Server/logs/application/ folder.
- Select an error log file and open it with a text viewer, for example Notepad.
- In the viewer, choose File => Print to print the logs content.
Configuring errors logs
The application server generates error logs. When necessary, refer to the application server documentation for more information to configure error logs.
Error logs can be recorded as identified files with a specific date format: application_log.YYYY-MM-DD.txt. The name and location of log files can be modified in the file COGNITUM-root/Server/webapps/application.xml:
<!-¬ Context configuration file for the COGNITUM Application
-->
<Context useNaming="true"
className="org.apache.catalina.core.StandardContext" charsetMapperClass="org.apache.catalina.util.CharsetMapper" debug="0" displayName="COGNITUM Application" docBase="TeamMate" mapperClass="org.apache.catalina.core.StandardContextMapper" path="/TeamMate" reloadable="true" wrapperClass="org.apache.catalina.core.StandardWrapper"> <Loader className="com.calendra.catalina.loader.DevLoader"
loaderClass="com.calendra.catalina.loader.WebappClassLoader" reloadable="true" debug="0" webclasspathFilename="../Server/devloader.classpath"/>
<Logger className="org.apache.catalina.logger.FileLogger" debug="0" directory="../Server/logs/TeamMate" prefix="TeamMate_log." suffix=".txt" timestamp="true" verbosity="1"/>
</Context>
Log files are generated automatically every day provided there are errors to log.
NOTE |
---|
For information on error logs made by application servers other than the one provided with COGNITUM, see the documentation issued by the application server manufacturer. |
When the log generation file is modified, the application server must be restarted to consider the new conditions.
To configure error logs
- In your file explorer, open the application.xml file in the COGNITUM-root/Server/webapps/ folder.
Change the following entries:
directory for the path of the error log files
- prefix for the beginning of the names of the error log files
- suffix for the end of the names of the error log files
timestamp to include the day in the names of the error log files
Save the file and restart the application server.
Production server error logs
Application servers generate errors logs as requested by hosted applications.
For COGNITUM, the logs list all the issues that the COGNITUM application cannot handle properly, like a wrong LDAP or SQL request or a data source failure. The error logs are very useful, since they can help pinpoint and troubleshoot errors easily.
The way errors are logged fully depends on the application server where the COGNITUM application is deployed. For more information, see the documentation released by the application server manufacturer.
COGNITUM Engine Monitoring Logs
COGNITUM includes the COGNITUM engine monitoring facility. The running state of the COGNITUM engine is traced and logged. Essentially used in production mode, the monitoring logs help pinpoint COGNITUM engine performance issues, or else application issues.
The monitor.log files are configured through the monitoring.dump.delay, monitoring.dump.formatter, and monitoring.dump.filter in the cdm.ini file. For more information, see The cdm.ini File in the COGNITUM Installation Guide.
The COGNITUM Engine logs record the activity of the COGNITUM engine through five monitors:
- The JVM monitor dumps the JVM used/free/total memory. For instance, the JVM log lines may show that the JVM free memory is close to null. The JVM heap size may then need to be increased.
- The Request Store monitor dumps the number of entries in the request cache. For instance, the Request Store log lines may show that there are too many requests in cache. The JVM heap size may be modified correctively.
- The LDAP Pool monitor dumps the status of all the LDAP pools. For instance, the LDAP Pool log lines may show overloads on the directory. The number of connections on the LDAP directory may then be increased as a corrective action.
- The RDBMS Pool monitor dumps the status of all the RDBMS pools. For instance, the RDBMS Pool log lines may show that the connections are hold or frozen. The stack trace can help identify the faulty computed attribute or the JSP. The attribute or the JSP code can be modified correctively.
The log files are stored in the folder COGNITUM-root/Server/logs/application/ They can be opened and printed with the editor for the format specified in the monitoring.dump.formatter key in the cdm.ini file.
NOTE |
---|
Configuring and using the COGNITUM Engine monitoring logs require some expertise. If necessary, contact the ITConcepts Customer Support. |
To view and print a COGNITUM engine monitoring log file
- In your file explorer, open the COGNITUM-root/Server/logs/application/ folder.
- Select the monitor.log file.
- In the viewer, choose File Print to print the log content.