venerdì 23 febbraio 2007

Sap J2EE engine logging

To view global configuration for logging of Sap J2EE engine (from version 6.40):
 
Log onto the Visual Administrator. First navigate to "Global Configuration -> Server -> Kernel -> LogManager" and check whether the properties
 
- ConsoleLogs_UseSapAPI = YES
- ForceSingleTraceFile = YES
- SingleTraceFile_UnrestrictedLocations = [empty]
 
have their preset values. With these properties, you can remove trace entries from the shared file trace, so that they are included in other files in the file system instead of here (./log/defaultTrace.trc). You should only ever do this for development purposes, never in live systems. Use only the default values for these three properties on all server nodes!
 
Caution: If these parameters are set directly on a server node "N" under "Cluster -> Server [N]-> Kernel -> Log Manager", the global settings are overridden. Therefore ensure that the properties on the affected server node have the values described above.
 
In the next step to modify severity level, navigate to the "Log Configurator" Service -> "Locations". Open the branch you want there and change the trace level in the field "severity" to (for example) DEBUG. Select "Copy Severity to Subtree" and save your entry. You have now set all Java components under that tree to the DEBUG level.
 
If you can isolate the error to particular parts of the J2EE engine set the trace level for the desired subcomponents only. In this way, you avoid unnecessary tracing. Make sure that you reset the trace level of the branch selected to ERROR, propagate this to the subtree, and then save.
 
For every server node N, the trace file appears in the file system under
 
/usr/sap/[SID]/[Instanz]/j2ee/cluster/server[N]/log/defaultTrace.[n].trc
 
The n trace files are written cyclically. You can change their size, number, and location in the file system using the kernel properties of the Log Manager (see above). Once a cycle is written, the files are zipped together and then saved for every server node in the directory
 
/usr/sap/[SID]/[Instanz]/j2ee/cluster/server[N]/log/archive
 
Tips and tricks:
- If the problem is so serious that the Visual Administrator Tool no longer starts or its performance is bad, use the "standalone log viewer" to display the log and trace files.
Start this under:
 
/usr/sap/[SID]/[Instanz]/j2ee/admin/logviewer-standalone/logviewer
 
With the standalone log viewer, you can display trace files (a) locally on the hard disk, (b) using the p4 port (5[Inst.Nr]04, for example, 50004 if your J2EE instance number is 00) or (c) connect to a LogViewer server. Detailed information about this is available in the "Logviewer_Userguide.pdf" in the directory mentioned above.
With the standalone log viewer, you cannot change the severity of a location. The standalone log viewer otherwise has exactly the same functions as the "integrated log viewer" of the Visual Administrator.
 
- The "command line log viewer" (lv.bat or lv.sh) is in the same directory as the standalone log viewer. You can use this tool to convert the default trace into a readable format. For example, call the script for this using
 
lv.bat defaultTrace1.trc -o defaultTrace1.txt -format %d %t %l %s %m
 
Use "lv -help" to help you find additional information about this tool.
 
- IMPORTANT: In addition to the default trace files described above, in the directory
 
/usr/sap/[SID]/[Instanz]/j2ee/cluster/server[N]/log/system
 
trace files are especially reserved for the J2EE Engine especially files (server.[i].log, database.[i].log, security.[i].log, userinterface.[i].log). Important information is often contained in "server.[i].log" if errors occur.
Use the mouse to select both the default trace and the "server.[i].log" in the standalone or integrated log. In the context menu of the right mouse key, select "Merge files and display". The displayed trace contains the information of both traces files (sorted according to date).
 
- The "Location" column of the trace files is very important for the developer analysis. Use "drag and drop" to drag the "Location" column of the log viewer to the third position beside the "time" and "date" columns. You can use the context menu of the right mouse button to select which columns should be displayed (click on the column names).
 
- Very often, you only need to send us individual rows of the trace (such as ERROR messages or stack traces) for an initial analysis. To do this, select the corresponding row(s) in the trace file display of the log viewer and choose "Copy" in the context menu (right mouse button). Send us this information directly using the SAP Service Marketplace. You can convert a trace row message (by double-clicking on the row) using the indicator "Use OSS Copy" directly to a format that is 72 characters wide.
 
Release Status: Released for Customer
Released on: 19.11.2004 13:39:22
Priority: Recommendations/additional info

Nessun commento: