Académique Documents
Professionnel Documents
Culture Documents
Monitoring.......................................................................................................................... 2 History Reports ................................................................................................................... 5 Managing Monitors with Monitor Browser ....................................................................... 6 Permanently Active Monitors ............................................................................................ 8 Activating and Deactivating Monitors .............................................................................. 10 Protokolldateien berwachen und anzeigen ................................................................... 11 Logging Features .............................................................................................................. 15 Log (Destination) .............................................................................................................. 18 Output File ........................................................................................................................ 19 Appendix C: Default Behavior of Certain Objects ............................................................ 21 Administrative Issues ....................................................................................................... 24 Formatter ......................................................................................................................... 25 Log Configuration ............................................................................................................. 28 Log Configuration with SAP NetWeaver Administrator ................................................... 29 GUI Config Tool................................................................................................................. 31 Connecting to a Database ................................................................................................ 32 Configuring JVM Parameters ............................................................................................ 35 Configuring Instances ....................................................................................................... 38 Adding and Removing Server Processes .......................................................................... 40 Adding Filters.................................................................................................................... 43 Configuring Shared Table ................................................................................................. 44 Modifying Service, Manager, or Application Properties .................................................. 45 Adding, Editing and Removing Log Controllers ................................................................ 49 Adding, Editing and Removing Log Destinations ............................................................. 51 Adding, Editing and Removing Log Formatters ................................................................ 53 Configuring Log Files Archiving ........................................................................................ 55 Exporting and Importing a Configuration ........................................................................ 56 Managing Secure Store Data ............................................................................................ 57 Log Viewing ...................................................................................................................... 59 Viewing Logs with the SAP Management Console ........................................................... 60 SAP Logging API ................................................................................................................ 62 LOG ..................................................................................................................................... 65
Monitoring
Die berwachung (Monitoring) des AS-Java-Systems soll dem Administrator helfen, Ressourcenengpsse oder Probleme frhzeitig zu erkennen und gegebenenfalls einzugreifen. Mit dem SAP NetWeaver Administrator knnen Sie den Anwendungsserver selbst sowie die auf ihm laufenden Komponenten und Anwendungen berwachen. Sie knnen den Funktionsumfang Ihrer eigenen Anwendungen erweitern, indem Sie berwachungsfunktionen hinzufgen und somit die berwachungswerkzeuge und die Infrastruktur zur berwachung Ihrer eigenen Anwendungen nutzen. Auerdem knnen Sie auf Protokolldateien von einem einzigen Standort aus zugreifen und so den zeitlichen Aufwand fr die Identifikation von Fehlern und fr Korrekturen reduzieren.
Die wichtigsten Informationen sind in einem Set vordefinierter Charts und Reports zusammengefasst. Auerdem knnen Sie Daten von jedem einzelnen Monitor im Monitoring-Baum des MonitoringBrowsers anzeigen und Ihre eigenen Reports und Charts zusammenstellen. Weitere Informationen: Java System Reports
Zentrales Monitoring
Wenn Sie SAP NetWeaver Process Integration 7.1 (PI) zentral berwachen mchten, mssen Sie die zentrale SAP NetWeaver Administration fr PI verwenden. Weitere Informationen zur Konfiguration und Verwendung der SAP NetWeaver Administrator fr PI finden Sie unter PI-Monitoring mit dem SAP NetWeaver Administrator
Zustzliche berwachungsfunktionen
Bei Bedarf an bestimmten berwachungsfunktionen bietet der SAP NetWeaver Administrator weitere Werkzeuge. Guided Procedures Monitoring Der GP-Monitor stellt Ihnen umfassende berwachungsfunktionen fr das Guided-ProceduresSystem und die dazugehrigen Anwendungen zur Verfgung und ermglicht Ihnen so, alle etwaigen Probleme ausfindig zu machen. Der GP-Monitor ist ein Guided-Procedures-Plug-In fr den SAP NetWeaver Administrator. Weitere Informationen: Guided-Procedures-Monitor (GP-Monitor) Open-SQL-Monitoring Wenn Open SQL fr Java fr den Zugriff auf die Datenbank verwendet wird, ist es wichtig, nachzuverfolgen, wie mit dem Persistenzspeicher umgegangen wird. Mit den Open-SQL-Monitoren knnen Sie die Durchfhrung von SQL-Anweisungen, den Pufferstatus von Tabellen und Katalogen sowie die Verfgbarkeit und Verwendung von Open-SQL-Datenbankverbindungen berwachen. Weitere Informationen: Open SQL Monitors Message-berwachung Mit Hilfe des Message-Monitoring knnen Sie nach Web-Service-Messages suchen, die in Ihrem System gesendet oder empfangen wurden. Sie knnen Messages berwachen, um den Status von Web-Service-Messages nachzuverfolgen oder um aufgetretene Fehler aufzuspren und ihre Ursache festzustellen. Weitere Informationen: Monitoring Messages Sequenz-Monitoring Mit Hilfe des Web Services Reliable Messaging (WS-RM) knnen Sie sicherstellen, dass die Kommunikation zwischen einem Service-Provider und einem Service-Customer fehlerfrei abgeschlossen wird. Sie verwenden die Analysewerkzeuge des Sequenz-Monitors zum Aufspren solcher Fehler. Mit Hilfe des Sequenz-Monitors knnen Sie beispielsweise seinen Status anzeigen oder fehlerhafte Sequenzen stoppen oder erneut starten. Weitere Informationen: Sequenzen berwachen Archivierungsmonitoring
Dieser Bereich ist Teil der Funktion des Java Archiving Cockpit. Hier knnen Sie den Fortschritt der Archivierung berwachen und Statistiken darber anzeigen, wie viele Objekte geschrieben oder gelscht wurden und von wem. Weitere Informationen: Java Archiving Cockpit Archiving Monitor
History Reports
Use History Reports as a problem detection and analysis tool to: Monitor the AS Java cluster and Java applications. Track the performance of one or all instances and cluster nodes of a particular Java system. Detect and analyze the causes of problems in an AS Java in a situation of reduced performance. Perform motivated tuning for productive use with the AS Java.
To monitor your AS Java, use the History Reports and Monitor Browser embedded functions. History Reports provides monitoring information via monitors and reports. Monitor Browser comprises a list of monitors in a table, where you can view their current status, state and type. You can view the traffic light of each monitor, which changes in case the values reported by the monitor exceed the predefined limits.
Activities
The most important actions you can perform with History Reports are listed as follows: Viewing and modifying the monitors in Monitor Browser For more information, see: Managing Monitors with Monitor Browser You can combine several monitors into your own custom report and configure the chart. More information: Composing Reports If you experience problems using the History Reports (for example, problems displaying monitors and reports, or lack of reported data), see Troubleshooting.
Resource Monitoring
History Reports .
Monitoring List
The monitoring list comprises all available monitors within your AS Java. The table provides the following monitor details: Name shows the complete monitor name and location. Status shows the current monitor's status via color thresholds. State shows the current monitor's state used, active or inactive. Type shows the monitor's type.
Color Thresholds
The list below defines the color statuses: System displays System displays (OK) if data is at normal level and no attention is needed. (Warning) if data values are moved to the next alert level and some problems
can occur soon. Attention is needed. System displays taken. System displays (Inactive) if the monitor is a non-performance one and/or is not working. If no (Alert) if data values are moved to the error level. Special measures must be
data is available, the monitor is not activated. You can reconfigure the threshold values if the predefined levels are not suitable for your needs. You can also activate or deactivate monitors that are important for your scenarios.
Prerequisites
Open SAP NetWeaver Administrator and then choose
Resource Monitoring
History Reports
Monitor Browser .
Procedure
Displaying and Updating Monitor's Values
When you select a monitor from Monitoring List, its details and description are shown in the Monitor Details and Monitor Configuration screen areas.
Configuring a Monitor
You can modify additional monitor settings, such as the monitor's description, color thresholds, data collection and so on. More information: Configuring a Monitor
Features
Monitors with Used State Monitor Monitor Type Kernel/Application Threads Pool/Usage Rate Kernel/Cluster Manager/MessageContext Communication/ General (MessageContext)/Average MS Process Time Kernel/Cluster Manager/SessionContext Communication/ General (SessionContext)/Average Session Process Time Kernel/Session Manager/Active Web Sessions Count Kernel/Session Manager/Logged-in Users Count Kernel/Session Manager/Opened EJB Sessions Count Kernel/Session Manager/Opened Security Sessions Count Kernel/Session Manager/Opened Web Sessions Count Kernel/System Threads Pool/Usage Rate Services/Http Provider/General/AllRequestsCount Services/JMS/Num of not started VPs/Not Started Virtual Providers Count Services/Keystore/System Entries Services/Keystore/User Entries Services/Log Configurator/General/TotalLogFileSize Services/Log Configurator/Messages/All Services/Log Configurator/Messages/Error Services/Log Configurator/Messages/Fatal Services/Log Configurator/Messages/Warning Services/Memory Info/Allocated Memory Services/Memory Info/Available Memory Services/Security/Aggregated Data/UnsuccessfulLogonAttemptsCount Services/Security/Data Per Application/SAP-J2EE-Engine/ UnsuccessfulLogonAttemptsCount Services/Security/Data Per Application/sap.com/com.sap.lcrsld/ UnsuccessfulLogonAttemptsCount Integer Integer Integer Integer Integer Integer Long Integer State State Long Long Long Long Long Integer Integer Long Long Long Integer Integer Integer
Monitors with Used State Monitor Monitor Type Services/Security/Data Per Application/sap.com/tc~dtr~enterpriseappdtr/ UnsuccessfulLogonAttemptsCount Services/Security/Data Per Application/sap.com/ tc~lm~itsam~ui~mainframe~wdwebdynpro_resources_sap.com_tc~lm~itsam~ui~ mainframe~wd/UnsuccessfulLogonAttemptsCount Services/Security/Data Per Application/service.naming/ UnsuccessfulLogonAttemptsCount Services/Security/Data Per Application/ticket/ UnsuccessfulLogonAttemptsCount Services/Timeout/EstimatedFrequencyPerMinute Services/Web Container/ AverageProcessingTime Long Long Integer Duration Long Long
Prerequisites
You have opened the Monitor Browser application. More information: Managing Monitors with Monitor Browser
Procedure
Activating Monitors
1. From the Show dropdown box, choose Inactive/Not Used. A table with all monitors of that kind are displayed. 2. Select a monitor you want to activate. 3. From the Monitor Configuration pane, choose the Activate button and then choose Save. 4. Go again to the Show dropdown box and choose Active/Used. The relevant monitor is displayed as activated in the table.
Deactivating Monitors
1. From the Show dropdown box, choose Active/Used. A table with all monitors of that kind are displayed. 2. Select a monitor you want to deactivate.
Note
You cannot deactivate monitors with state Used, since they participate in the History Reports. More information: History Reports 3. From the Monitor Configuration pane, choose the Deactivate button and then choose Save. 4. Go again to the Show dropdown box and choose Inactive/Not used. The relevant monitor is displayed as inactive in the table.
Konfiguration
Die nachfolgende Tabelle enthlt Konfigurationseinstellungen, die Sie festlegen knnen, wenn die Standardeinstellungen nicht geeignet sind:
Konfigurationsaufgabe Log-Controller-Severities konfigurieren Beschreibung Sie verwenden das Werkzeug Log Configuration im SAP NetWeaver Administrator. Die Standardwerte fr den Schweregrad sind:
fr Kategorien INFO fr Standorte FEHLER Weitere Informationen: Log Configuration with SAP NetWeaver Administrator
Sie knnen den Speicherort fr Trace-Dateien konfigurieren, indem Sie den Log Manager verwenden. Weitere Informationen: Log Manager
Die Protokoll-und Trace-Archivierung ist standardmig ausgeschaltet. Sie knnen Sie einschalten, den Archivierungsspeicherort konfigurieren und angeben, welche Dateien archiviert werden sollen. Weitere Informationen: Configuring Log Files Archiving
Aufgaben
Die nachfolgende Tabelle enthlt Aufgaben, die Sie bei Bedarf durchfhren knnen:
Aufgabe Protokolle bei laufendem AS Java filtern und anzeigen Beschreibung In jeder vordefinierten Sicht oder benutzerdefinierten Sicht knnen Sie Protokoll- und Trace-Stze von AS Java nach einem bestimmten Kriterium filtern und anzeigen. Weitere Informationen: Filtering Logs and Traces
Aufgabe Protokolle bei nicht laufendem AS Java filtern und anzeigen Protokollstze mit Schweregrad ERROR oder FATAL anzeigen Protokolldateien lschen
Beschreibung Wenn kein AS Java auf dem zu berwachenden System luft, knnen Sie Protokoll- und Trace-Stze mithilfe eines entfernten Log Viewer filtern und anzeigen. Weitere Informationen: Connecting to a Remote System Um die SAP NetWeaver-Systemlandschaft auf kritische Zustnde hin in jeder beliebigen vordefinierten oder benutzerspezifischen Sicht zu berwachen, knnen Sie nur die Protokoll- und Trace-Stze mit Schweregrad ERROR oder FATAL herausfiltern und anzeigen. Sie knnen Protokolldateien auf drei Arten lschen:
Automatisch Wenn die Protokolle die Gre von fnf Dateien mit jeweils 10 MB erreichen, fangen die neuen Protokolle an, die alten Protokolle zu berschreiben, die somit automatisch gelscht werden. Wenn Sie die Archivierung aktivieren, erstellt das System eine Sicherungskopie im ZIP-Format vom Set der fnf Dateien und fngt an, die erste Protokolldatei zu berschreiben.
Sie knnen manuell den Teil der Protokoll- oder Trace-Dateien lschen, den Sie nicht bentigen z.B. die Standard-Traces.
Achtung
In einigen Lndern ist das Erstellen von Sicherungskopien der Sicherheitsprotokolle per Gesetz vorgeschrieben. Aus diesem Grund mssen Sie regelmig Sicherungskopien von Ihren Sicherheitsprotokolldateien anfertigen und aufbewahren.
Sie knnen jene temporren Protokoll- und Trace-Dateien lschen, die vom System generiert werden, wenn Sie Archive mit Hilfe des Log Viewer anzeigen. Wenn Sie Archive von Protokollen und Traces ffnen, werden die Protokoll- und Trace-Dateien jedes Archivs in das temporre Unterverzeichnis ./log/archive/temp extrahiert. Die Protokoll- und Trace-Dateien werden anschlieend nicht aus diesem temporren Verzeichnis gelscht. Beim nchsten Mal werden die Archive daher schneller angezeigt.
Empfehlung
Sie sollten diese Protokoll- und Trace-Dateien regelmig lschen, um Plattenplatz freizumachen.
Beschreibung Es gibt zwei Arten der berwachung fr Protokolle und Traces fr die Datei- und die Archivierungsgre. Weitere Informationen: Log Configurator Sie knnen auch die Einstellungen der berwachungsampel ndern z.B. den Wert, wenn die berwachungsampel von gelb auf grn wechselt. Verwenden Sie dafr den Monitor Browser in SAP NetWeaver Administrator. Weitere Informationen:Monitor Browser
Werkzeuge
Mit dem Werkzeug Log Viewer in SAP NetWeaver Administrator knnen Sie alle als Liste oder Text formatierten Protokolle und Traces anzeigen, die innerhalb der gesamten SAP NetWeaverSystemlandschaft erzeugt werden. Sie knnen zur berwachung und Anzeige von Protokollen auch die folgenden Werkzeuge benutzen: Log Viewing with the SAP MC Command Console Log Viewer
Weitere Informationen
Im Verzeichnis <SAP_Installationsverzeichnisr>\<Systemname>\<Instanzname>\j2ee\cl uster\<Servername>\log finden Sie folgende Protokolle: \system\database.log \system\security.log \system\server.log \system\logging.log \system\userinterface.log \system\configchanges.log \application.log Zustzlich stehen die folgenden speziellen AS-Java-Log-Controller zur Verfgung:
AS-Java-Komponente AS Java allgemein Business Process Management Protokoll-Kategorie Trace-Lokation
Protokoll-Kategorie
Trace-Lokation
/Applications
Guided Procedures Portal 1. Probleme in der Administrationsumgebung 2. Probleme bei der objektbasierten Navigation (OBN) 3. Probleme bei der Portalanbindung 4. Probleme bei Portalen im Verbund 5. Probleme beim Anlegen von Content mit XMLScripts (Generic Creator) 6. Probleme bei Berechtigungen/Sicherheit 7. Probleme beim Deployment von Content 8. Probleme bei der Darstellung von Seiten
/Server /System/Server
com.sap.caf.eu.gp.*
1.
com.sap.portal.adminstudio com.sap.portal.admin.adminstud io
2. 3. 4. 5.
6.
com.sap.portal.pcd com.sapportals.portal.security
7. 8.
com.sap.portal.prt.sapj2ee com.sap.portal.pb
com.sap.sa.rt* com.sap.vc.server05
/Server
/System/Server/WS com.sap.engine.services.webservice s
Logging Features
The following main features help you to manage your logging functionality and activities.
Features
Logging
Logging is a process of creating and storing permanent records of events that can be reviewed, printed and analyzed. Log records provide the following common information: a short descriptive message a timestamp of the event the source of the record the log controller a severity, specifying the importance of the record the host, system and instance name the server process
Log files are used by system administrators to identify problems in system operations. Therefore, logs are always switched on and get written automatically. They have predefined granularity (severity) that can be modified during runtime.
Tracing
Tracing is a process of writing detailed information about an operation to an output file. Trace records provide the following: a detailed sequence of statements that describe the events of an operation as they are executed diagnosing of an abnormal condition
Trace files are used by support engineers and developers. Therefore, tracing is normally turned off. Traces can be switched on if a problem has occurred and a detailed analysis of a distinct part of a program is necessary.
Log Manager
Log Manager is a module that manages the process of logging system events. The Log Manager is part of the Java Enterprise Runtime and is the first manager to be started at system startup. Using the Log Manager properties, you can reconfigure the default system log archiving and tracing behavior.
Levels of Severity
An important part of any log and trace message is its severity. It denotes the level of importance or relevance of a certain message. Logs and traces can be limited to certain severity levels, that is, only data of a defined severity is collected. The increasing order of the severity levels is: DEBUG For debugging purpose, with extensive and low level information. PATH For tracing the execution flow. INFO Informational text, mostly for announcing what has been performed. WARNING The application can recover from an anomaly and fulfill the required task, but needs attention from a developer/operator. ERROR The application can recover from an error, but it cannot fulfill the required task due to the error. FATAL The application cannot recover from an error, and the situation causes fatal termination.
Note
Log controllers are also identified with certain severity.
Message ID
Message ID is a unique identifier assigned to each log/trace message, generated in the AS Java. The uniqueness of the concept do not allow two logs/traces to have one and the same Message ID assigned. A Message ID represents the following string: [prefix] : [range] [number], where: prefix a meaningful word or abbreviation concerning an AS Java component. range a two-symboled combination that consists of number and lowercase Latin alphabet characters. namespace this is equal of <prefix + range>. It is unique for each Message ID, too.
number a number from 0 to 9999 with leading 0s. The first number is 0000 and the last possible number in a range is 9999. Each Message ID has unique number in the range.
Activities
Using logging functionality, you can: Configure log controllers, destinations and formatters. More information: Log Configuration View all available logs and traces in AS Java. More information: Log Viewing Develop logging for your own applications using the SAP NetWeaver Developer Studio. More information: How to Write Log and Trace Messages Enable the logging and the output messages of your application. To do this, use the SAP Logging API. More information: SAP Logging API Perform some advanced logging tasks by using the LOG group of shell commands. More information: LOG
Log (Destination)
A log represents the destination where the messages are written. Like the log controller, a severity level can be defined for each log. Unlike the default for log controller (Severity.NONE), the default for a log is Severity.ALL. That is, there is no effect on the main severity level check with the log controller.
Note
To avoid confusion, all the possibilities to change the severity of a log have been removed. Therefore, currently user can consider logs as they have no severity at all. Currently, the following logs are predefined: ConsoleLog - directs the messages to the System.err (java.lang.System). This log type is typically used in the debugging process for a quick overview of problems. FileLog - directs the messages to a file or a set of rotating files. More information: Output File. StreamLog - directs the messages to an arbitrary OutputStream (java.io.OutputStream);
Activities
Commonly, log controllers inherit the logs from their parent controllers. However, in the log configuration, there are some log controllers that do not inherit from their parents. They have logs assigned to them according to the default configuration instead. The purpose of those log controllers is not to write their messages to the defaultTrace.trc file (which is considered public), but to write to their own specific destinations. The main reason for this is security.
Output File
Directing messages into a file is a very common practice. In the SAP Logging API, this is done by assigning FileLog to your source objects. This section explains certain common configuration features to complement the JavaDocs. More information: Appendix C: Default Behavior of Certain Objects. By default, messages written to an output file are in the ListFormatter, without using any special character encoding. There is only one single output file that constantly increases in size. There are a number of options you can use to configure the behavior of an output file, using the SAP Logging API: Filename Limit file size and do sequencing on the output file Choose FileLog or physical file
Features
Filename
The filename can be expressed as a full file path or in a pattern with a number of available placeholders. This can help the potential "hardcoding" problem and platform dependent issues, such as the filename separator.
Placeholder Description Comments "C:\temp\trace.log == ""C:/temp/trace.log"
%h %t
The value of the system property:"user.home" The value of the system property: java.io.tmpdir"". Normally, it is "C:\temp". Therefore:"C:\temp\trace.log" == "%t/trace.log" To avoid file naming conflicts.
%u
%%
%g
This is useful only when you specify the file size limit and the maximum number count to do rotation. By default, this is appended to the end of the filename/file pattern specified. For example: "%t/trace.%g.log " "C:\temp\trace.0.log".
Syntax
1. FileLog _file = new FileLog("%t/trace.%g.log", 800000, 10, new TraceFormatter()); In case of the configuration file, the syntax is:
Syntax
1. 2. 3. 4. 5. log[File] log[File].pattern log[File].limit log[File].cnt log[File].formatter = = = = = FileLog %t/trace.%g.log 800000 10 TraceFormatter
The first output file is created in the "C:\temp\trace.0.log" (sequence number starts with '0' ) and when its size exceeds the limit (800,000 bytes), the next incoming message will be directed to a new file "C:\temp\trace.1.log". This process continues to the last sequenced file "C:\temp\trace.9.log" (count = 10). Then the next file to be written will be again in " C:\temp\trace.0.log".
1:1 Recommended
The FileLog and the actual output file must be in a 1:1 relationship.
Recommendation
We recommend that you do not create two instances of the FileLog on the same file with different configuration. For example, one with TraceFormatter and another with XMLFormatter. If do so, you may not synchronize the messages in a multi-threading environment correctly. The full message text may be interrupted and interwoven with another message text.
LogController Severity
Severity.NONE
MinSeverit Severity.ALL y MaxSeveri Severity.NONE ty <output logs> <filters> Log Severity <filters> ConsoleLog FileLog Formatter Formatter Limit
<none>
No output at all.
Jan 01, 2001 10:10:00 PM com.sapmarkets.FooClass.fooMethod [main] Fatal: A sample fatal message
ListFormatter
Pattern
Example:
#1.3#10.48.27.165:4A5AB2:E99D42D4F4:8000# Mon Jan 01 22:00:00 PDT 2001# com.sapmarkets.FooClass# com.sapmarkets.FooClass. fooMethod#main##0#0# Fatal##Plain###A sample fatal message#
Class
Attribute
Default Value
Description Example:
XMLFormatte Pattern r
<!ELEMENT log
(record*)><!ELEME <record> NT table (id, time, source, severity, <id>10.48.27.165:4A5AB2:E99D2EDAFF: 8000</id> <time>Mon Jan 01 22:00:00 PDT 2001 </time>
location, thread, <source>com.sapmarkets.FooClass</sourc msg-type, msgcode?, bundle?, msg-clear?, args?)><!ELEMENT id e> <location>com.sapmarkets.FooClass.fooM ethod </location> <thread>main</thread> <severity>Fatal</severity> <msg-
(#PCDATA)><!ELEME </record> NT source (#PCDATA)><!ELEME NT severity (#PCDATA)><!ELEME NT location (#PCDATA)><!ELEME NT thread (#PCDATA)><!ELEME NT msg-type (#PCDATA)><!ELEME NT msg-code (#PCDATA)><!ELEME NT bundle (#PCDATA)><!ELEME NT msg-clear (#PCDATA)><!ELEME NT args (arg+)><!ELEMENT arg (#PCDATA)> Highlights of Default Behavior
Class Property Default Value Description
Class Location
Default Value
""
Category
root name
"/"
FileLog
Trace
%t/trace.log
TraceFormatter
Message displayed
Content of 'MsgClear' in Either translated text in 'MsgClear' or text any case. Optional provided by users explicitly in 'MsgClear'. Both MsgCode & MsgClear available, up to the viewer. Optional Both MsgCode & MsgClear available, up to the viewer. Nothing is output by relative 'A'. Relative 'A' unaffected, and still has default Severity.NONE and no output destination. Only when explicit configuration is done on relative 'A', the output is generated by it.
ListFormatter
Message displayed
XMLFormatter
Message displayed
OutputBehavior by relative
Administrative Issues
Error Handling Mechanism
The error handling mechanism must be done carefully in the logging tool. It must not disturb the running application. Therefore, the errors occurring within the logging framework have to be thrown and caught appropriately.
Workaround
The approach is to tolerate the exception and to correct the error. The program then continues to run. The exception is not lost; it is stored temporarily and can be retrieved by the caller through the getException() and throwException() methods.
Examples
Some of the potential mistakes are: invalid severity definition, poor configuration, meaningless null message string, wrong resource bundle information, and so on. These can be rectified internally and a message can be logged to indicate the problem without terminating the program. There are several ways for replacing the incorrect value with the best-guess value: Using the default value. More information: Appendix C: Default Behavior of Certain Objects. Estimating the closest value. Ignoring it.
Example
For example: o Invalid configuration for FileLog for the pair of parameters limit and cnt. The default setting for FileLog is used. That is, limit and cnt are both equal to zero. o If a spelling error occurs when defining a Log or Formatter, the value is ignored and nothing is assigned. o A message string or message code must not be a null string. However, if this happens, a constant <null> is assigned. o When a message code cannot be resolved to a localized string, the value of the message code is used directly. Exceptions generated from methods, called in static field declarations and initializers, lead to an immediate program termination when the class is loaded.
Formatter
Each log destination type can print messages in different formats: TraceFormatter, XMLFormatter, and ListFormatter.
Features
TraceFormatter
A human readable format. The most commonly used formatter when you want to understand quickly what is happening with the application. The default pattern: %24d %-40l [%t] %s: %m The corresponding output is:
Jan 01, 2007 10:10:00 PM com.sapmarkets.FooClass.fooMethod [main] Fatal: A sample fatal message.
For example, if the pattern becomes %24d %l [%s] %m, the corresponding output is:
Jan 01, 2001 10:10:00 PM com.sapmarkets.FooClass.fooMethod [Fatal] A sample fatal message.
The number in the pattern denotes the width of a field. In the first example: %-40l indicates a limit of 40 chars for the location name (com.sapmarkets.FooClass.fooMethod) that will be right-aligned (with a minus sign). If the length of a string exceeds the defined width, the string will be truncated. In the second example: %l displays the full string that will be left-aligned.
XMLFormatter
Suitable for file transfer to be further processed in other applications.
Syntax
1. <record> 2. <id>10.48.27.165:4A5AB2:E99D2EDAFF:-8000</id> 3. <time>Mon Jan 01 22:00:00 PDT 2001</time> 4. <source>com.sapmarkets.FooClass</source> 5. <location>com.sapmarkets.FooClass.fooMethod</location> 6. <thread>main</thread> 7. <severity>Fatal</severity> 8. <msg-type>Plain</msg-type> 9. <msg-clear>A sample fatal message</msg-clear> 10. </record> The DTD of the result is:
Syntax
1. <!ELEMENT table (id, time, source, location, thread, group?, severity, relatives?, msg-type, msg-code?, bundle?, msg-clear?, args?)> 2. <!ELEMENT id (#PCDATA)> 3. <!ELEMENT time (#PCDATA)> 4. <!ELEMENT source (#PCDATA)> 5. <!ELEMENT location (#PCDATA)> 6. <!ELEMENT thread (#PCDATA)> 7. <!ELEMENT group (id, level, indent)> 8. <!ELEMENT level (#PCDATA)> 9. <!ELEMENT indent (#PCDATA)> 10. <!ELEMENT severity (#PCDATA)> 11. <!ELEMENT relatives (relative+)> 12. <!ELEMENT relative (#PCDATA)> 13. <!ELEMENT msg-type (#PCDATA)> 14. <!ELEMENT msg-code (#PCDATA)> 15. <!ELEMENT bundle (#PCDATA)> 16. <!ELEMENT msg-clear (#PCDATA)> 17. <!ELEMENT args (arg+)> 18. <!ELEMENT arg (#PCDATA)>
ListFormatter
The output of this format serves like a router. That is, it sends the data for further processing by another application, instead of being read directly by the user. Simple hash-separated fields to be processed mainly with the Log Viewer. More information: Log Viewer Sample output of the same result is:
#2.0#2008 04 15 18:47:29:778#+0300#Info#/System/Changes/configtool# ###C0000A37462200020000000201BE2893###configtool########Thread[Thread-6,5,main]#Plain## Number of debug nodes was changed from 1 to 1 for Instance - ID543210#
The order of the fields, delimited by the hash sign is: o o o Version (of the ListFormatter) Message ID Timestamp
o o o o o o o o o o o
Source name (log controller) Thread ID Location name (the actual code location that generates the message) Group indentation Message severity Message Type (PLAIN or JAVA) Message Code ResourceBundle name Message Number of arguments Arguments
Log Configuration
You can perform log configuration activities, using the following methods: Configuring the severity of log controllers on a system or a certain instance level at runtime More information: Log Configuration with SAP NetWeaver Administrator Performing advanced log configuration tasks, such as creating log controllers, adding log destinations, configuring log formatters, and so on. More information: Log Configuration with Config Tool Activating or deactivating log files archiving More information: Configuring Log Files Archiving Performing advanced log configuration tasks using the LOG group of shell commands. More information: LOG
Troubleshooting
Log Configuration .
Integration
If you want to view the logs and traces of your AS Java, choose
Relative Links
Log
Viewer .
More information: Log Viewer
Features
Log Controllers
Log controllers are objects that manage the writing of log and trace messages. Two types of log controllers are available: Location describes messages that originate from delimited source code areas. It is used to store and emit trace messages. Since trace messages are meant for developers and support engineers, they are organized along code packages. In SAP NetWeaver Administrator, locations are named as tracing locations. Category describes messages specific to distinguished problem areas. It is used to store and emit log messages. Typical problem areas are: databases, networking, security auditing, and others. In SAP NetWeaver Administrator, categories are named as logging categories.
Note
The configuration steps for both logging categories and tracing locations are the same. Therefore, the steps in the configuration procedures treat them as a whole.
Severity levels
The severity denotes the level of importance or relevance of a certain message. The increasing order of the severity levels is: ALL The lowest severity. Controller with such a severity logs all the messages regardless of their severity. DEBUG For debugging purpose, with extensive and low level information.
PATH For tracing the execution flow. For example, entering and leaving a method, looping and branching operations and so on.
INFO Informational text, mostly for announcing what has already been performed. WARNING Announces that the application can recover from an anomaly and fulfill the required task, but needs attention from a developer/operator.
ERROR Announces that the application can recover from an error, but it cannot fulfill the required task due to the error.
FATAL Announces that the application cannot recover from an error, and the situation causes fatal termination.
NONE The highest severity. Log controllers with such a severity suppress all the messages logged into them, except for the messages with the same severity.
Activities
Configuring Log Controllers
Features
The following are the advantage tasks you can do using the GUI Config Tool (in comparison with the command console Config Tool): Change the configuration template Make log configuration Manage the secure store data Search for properties in Config Tool Add filters
Activities
Here is a list of all the tasks available for GUI Config Tool: Connecting to a Database Configuring JVM Parameters Configuring Instances Adding and Removing Server Processes Adding Filters Configuring Shared Table Modifying Service, Manager or Application Properties Log Configuration with Config Tool Configuring Log Files Archiving Activating a Configuration Template Exporting and Importing a Configuration Managing Secure Store Data
Connecting to a Database
This procedure enables you to connect to a remote database and display an installed AS Java configuration.
Procedure
1. Start the Config Tool by double-clicking the configtool script file in <SAP_install_dir>/<system_name>/<instance_name>/j2ee/configtool directory. 2. In the Connection settings dialog window, choose "Yes" if you want to connect to the default database, or "No" to connect to a different one. The default database connection is via the Secure Store.
Note
If you check the "Do not ask me again" indicator, next time you start the Config Tool, it will automatically connect to the default database. To connect to a different database, you can remove the config.properties file from the configtool directory. Then, start the Config Tool. 3. In the Connect dialog window, choose whether to connect via secure store or via direct login and enter the required data in the relevant fields.
Connecting Settings Secure Store Settings Secure Store File Contains the path to the secure store properties file. This file is encrypted for security reasons. Secure Store Key File Contains the path to the secure store key file. The key file contains the password for the encrypted store file. System Name Displays the name of the system to which this data applies. Description Example
C:\usr\sap\LKG\SYS\global\security\data\SecStore .properties
C:\usr\sap\LKG\SYS\global\security\data\SecStore .key
LKG
Specifies the security directory. It contains IAIK JAR files you need to use to open the Secure Store.
C:\usr\sap\LKG\SYS\global\security\lib
RDBMS
jdbc/pool/LKG
Connectio the value contains the DB ns Direct Login Settings RDBMS URL Specifies the URL for the database connection in the correct format for the corresponding driver. Driver name Specifies the class name of the JDBC driver to be used for database connections. RDBMS user Specifies the user name for this database connection. RDBMS password Specifies the password set during the installation of the relevant AS Java. IAIK Library Specifies the IAIK JAR files directory. It enables the encrypting and decrypting of the properties file. connection settings. Description Example
jdbc:sapdb://sofD60163517A/CE1?timeout=0&spaceop tion=true&unicode=true
com.sap.dbtech.jdbc.DriverSapDB
SAPLKGDB
General Settings
Description
Example
C:\\sapdb\programs\runtime\jar\sapdbc.jar
Connectio be created initially in the ns RDBMS Maximum connection pool. Specifies the maximum number of database
10
After filling in the connection fields, you have the following options: Directly connect to the relevant database. Choose Connect to DB. Save the connection properties you have just set as following: 1. Choose Save Connection As. 2. Enter a file name with the extension .properties, for example user.properties. 3. Choose Save. Open a previously saved .properties file to connect to a database. Choose Load Connection Settings.
Result
You have successfully connected to a database. After opening the GUI Config Tool, you can proceed the following steps for better future use: If you want the Connection settings dialog box to appear again on startup, choose Startup Options. . Then, in the dialog window, check Show connection dialog. View
The other way is to delete the visual.properties file. Then, start the Config Tool. If you use a Linux or Unix operating system, choose dialog box, check Use loading indicator. This is necessary for the system to provide a better performance of the GUI Config Tool when you work with instances. View Startup Options . Then, in the
Note
If you are not available to proceed this via the GUI tool, in the configtool folder, open the visual.properties file for text editing. Then, add the line: show.loading.indicator=YES.
Note
You cannot delete default or inherited properties but only custom ones. All the properties on an instance level are shown with their calculated values. That is, if a property has a link value (formula), in the table its calculated value is displayed. When you select the property, you can see its default link value in the Inherited Value field.
Prerequisites
Start the Config Tool by double-clicking the configtool script file in <SAP_install_dir>/<system_name>/<instance_name>/j2ee/configtool directory.
Procedure
Configuring JVM Environment Properties
1. Choose the template or the instance you want to configure. 2. Select VM Environment. 3. Select a property from the table below. 4. In Default/Inherited Property Data, you can see the default value of the property. 5. In Custom property data, you can enter a new value for the property.
Caution
Avoid editing properties which values are not static (link values), such as DebugPort and ClassPath. 6. Choose Set Custom Value. 7. Choose (Apply Changes).
8. If you want to retrieve the default value of the property, choose Restore to Default Value. 9. In order the changes to take effect, restart AS Java.
View
Expert Mode .
3. Select VM Parameters. 4. In VM Type, you can make configuration changes that are specific for the selected JVM. These changes apply only if the current platform and vendor matches. The changes made in GLOBAL vendor apply to all vendors and platforms.
Recommendation
We recommend that you use sap vendor on all supported platforms. 5. Via the following tabs you can configure the relevant template properties: o Memory JVM memory settings. o JVM heap size
Recommendation
If you want to increase the JVM heap size, we recommend that you change only the maxHeapSize. Enter the required memory value (in megabytes) in the Custom value field. o JVM perm size If you enter an illegal value (for example, the value is not a number), the AS Java will not start. If you enter a value that is too low, the AS Java will experience problems and may restart. o System all system properties usually specified with -Dxx=yy (for example, DmyKey=myValue). If you want to add a custom property, choose New. The Config Tool automatically adds D to all newly-entered parameters. o Additional any additional parameters, supported by the JVM (for example, verbose:gc). To add JVM parameters, choose New. The property is added to Custom parameters. The actual parameters used by a running JVM can be found in the development trace file of the corresponding server process. For example:
Example
key="-agentlib:myagent" value="port=12345,dir=C:/Mydir" This results in parameter: "-agentlib:myagent=port=12345,dir=C:/Mydir". 6. By default, all properties are enabled. 7. To enable/disable a parameter from the Custom Parameters table, choose the parameter and then select Enable/Disable. 8. To change the value of a property, select it from the table and in the Custom value field, enter the new value.
Note
For more advanced tasks (for example, to use a different vendor-platform combination), choose
View
Expert Mode
8. If you want to retrieve the default value of the property, choose Restore to Default Value. 9. In order the changes to take effect, restart AS Java.
Note
To add VM parameters on a template level, choose 2. Choose the VM Parameters tab. It is not possible to add new memory VM parameters but only system and custom ones. 3. To add a system parameter, choose System. o o Enter a name as required. Optional: enter a value and description.
View
Expert Mode .
4. To add a custom parameter, choose Additional o o o Select a VM parameter from the list. Optional: enter a value if the Value field is available Predefined description appears automatically. You can change or delete it.
5. The new VM parameter appears in the Custom Parameters table. 6. Choose (Apply Changes).
Configuring Instances
This procedure enables you to manage Java instances. You can add and remove server processes, disable instances, or view and edit the JVM settings. If you change the properties of an instance, the changes apply only to this instance.
Prerequisites
Start the Config Tool by double-clicking the configtool script file in <SAP_install_dir>/<system_name>/<instance_name>/j2ee/configtool directory.
Procedure
Adding and Removing a Server Process
More Information: Adding and Removing Server Processes
To run an instance that has been stopped, set the value of the Execute property to true. 6. In order the change to take effect, restart the AS Java.
VM Environment
Custom value .
3. Enter the new value of the following settings: o o Debuggable the debug mode feature for the selected instance is enabled. DebugMode specifies whether the instance is in debug mode and if the debug port is open.
Note
When you enable debug mode for an instance, first make sure you have stopped all message-driven beans running on that instance.
Note
In case, your applications contain message-driven beans whose destination type is Topic, you also need to start the message-driven beans on another server process. o LoadBalanceRestricted specifies whether the instance is part of the load balancing system. o DebugPort specifies the JVM debug port. The default value depends on the instance number and server process index number. For example, if the instance number is 00, the debug port is 50026 for server0. 4. Choose (Apply Changes).
Note
When planning the number of server processes you want to have in an AS Java instance, you can allocate one of them for debugging. This means that when you start AS Java, this debuggable server process will not be operational in order to reduce the system resources consumption. When a problem appears in AS Java, you can start this server process using the SAP MC and connect to it with debugger. The debug server process is not included in the load balancing so end users will not experience stale requests (due to debugger breakpoints). However, you will still be able to monitor how your application/components behave in a cluster, inspect data and evaluate expressions. More information: Enabling Debugging If you need to add more server processes to an existing Java instance, you can do that manually using the Config Tool. You can configure the number of server processes on two levels: template level If you define a number of server processes on a template level, the number will be relevant for all Java instances in the cluster. Java instance level If you specify a number of server processes for a particular Java instance, the number will be relevant only for this particular Java instance.
Prerequisites
You have installed the basic components of the cluster. Make sure the AS Java is stopped.
Procedure
1. Start the Config Tool by double-clicking the configtool script file in <SAP_install_dir>/<system_name>/<instance_name>/j2ee/configtool directory. 2. From the tree-structure, choose the template or a Java instance according to the level you want to make configurations. 3. Choose the Servers tab. 4. In the Custom Number of Server Processes field, enter the number of server processes you want to have. 5. Choose Check Value to verify that your server is capable of handling the number of server processes you entered. Correct the value if necessary.
Note
This option is available at instance level only.
If the template configuration allows you to enter a formula instead of an exact value, then the Check Value option calculates the formula and displays the value. 6. Choose Set. 7. If you want a server process (in a particular instance) to be debuggable, select the Debug a Server Process checkbox.
Note
You can set only one node for debugging in an instance. For more information, see the NOTE paragraph at the beginning of this page. 8. Choose
(Apply Changes).
Adding Filters
A filter enables you to start, stop, or disable services, libraries and applications. You can add filters and also edit or delete already created filters. If you set action filters on configuration template level, the filters apply to all instances. If you set filters for a particular instance, only this instance will have the filters applied.
Procedure
1. Start the Config Tool by double-clicking the configtool script file in <SAP_install_dir>/<system_name>/<instance_name>/j2ee/configtool directory. 2. Choose
View
Expert Mode .
3. Choose the configuration template or the relevant instance, for which you want to add filters. 4. Select Filters. A table of default actions for particular components is displayed. 5. In Custom rules pane, select what action should be performed: start, stop, or disable. 6. Select the type of component: service, library, application, or all components. 7. From Vendor Mask, enter the vendor of the component. 8. From Component Name Mask, enter the name of the component. Part of the name is a valid string.
Note
You can use the asterisk sign (*) to replace part of the name or the question mark (?) to replace a single letter. 9. Choose Add. The action is added to the Custom rules table. 10. In the table with custom actions, select the added entry and choose Set. 11. Choose (Apply Changes).
Note
If you change the properties of an instance, the changes applies only to this instance.
Procedure
1. Start the Config Tool by double-clicking the configtool script file in <SAP_install_dir>/<system_name>/<instance_name>/j2ee/configtool directory. 2. From the tree structure, choose the template or an instance. 3. Choose
View
Expert Mode.
4. Choose Shared Table tab. 5. Select the property you want to configure. 6. In the Custom Property Data field, enter the new custom value.
Recommendation
We recommend that you make this configurations on a template level. That helps in case the AS Java is updated to apply the updates to all instances. 7. Choose Set Custom Value. 8. Choose (Apply Changes).
Note
The instance configuration has priority over the template configuration. That is, if you set a custom value on a template level, and then set a different value for the same property in a particular instance, then the instance configuration is considered. The properties in an instance configuration are divided in two sections: Inherited property data Displays the template default value of a property. If there is a template custom value, then it is displayed. Otherwise, the template default value is displayed. Custom property data Displays all custom settings of a property in an instance.
Features
The properties can be defined with additional parameters, such as type, range, computed, parameterized, and link. More information: Basic Features of the Config Tool. You can overwrite instance properties values with template ones. Particular services and managers may have another feature nested properties. The children properties are separated by a slash (/).
Note
You can view and modify nested properties in Expert Mode only.
Prerequisites
Start the Config Tool by double-clicking the configtool script file in <SAP_install_dir>/<system_name>/<instance_name>/j2ee/configtool directory.
Procedure
Setting a Template Custom Value for All Instances
1. Open the template configuration and select a service, manager or application. 2. Select the property from the table displayed. 3. In Custom value, enter a new value. 4. Choose Set Custom Value. 5. Choose
(Apply Changes).
(Apply Changes).
View
Expert Mode .
2. Open the template or an instance configuration. 3. Select the relevant service or manager that contains nested properties. The children properties are separated by a slash (/). 4. To set another value for the property, in the Custom value field, enter the new value. 5. To create a new nested property, choose New. A dialog box appears. o In the Name field, enter the relevant string.
You have to first enter the path, using slashes, and then add the property name (key) at the end. EXAMPLE The following sample Java source:
Syntax
1. ReverseProxyMappings 2. ProxyConfigurations 3. Proxy1 4. HttpProxyPort=80 5. Header 6. HeaderName=via represents two property strings: ReverseProxyMappings/ProxyConfigurations/Proxy1/ HttpProxyPort ReverseProxyMappings/ProxyConfigurations/Proxy1/Header/ HeaderName , where HttpProxyPort and HeaderName represent the property keys of the nested properties. o o In the field Value, enter a value for the property key. Optional: You can enter a description for the property.
Caution
Only the property key is deleted. The property path cannot be deleted but it is no longer visible in the Config Tool. 7. Choose
(Apply Changes).
Note
You can configure more that one property for a service, manager or application before saving the changes. 6. Choose
(Apply Changes).
A dialog box appears, announcing that another value with higher priority is already set for the same property. You have the following options: o Leave the property selected and choose OK.
The template value overwrites all the instances' values (if more instances) for the selected property. o Deselect those template properties which you want to not overwrite the instances' ones. Then choose OK. o Choose Cancel. None of the selected template properties will overwrite the instances' ones.
(Properties Search).
2. Enter the name of the property. Part of the name is a valid string. 3. Choose Start. On the Results pane, all the properties containing the string appear. Each result line also displays the path and the values of the property. 4. To locate the property in Config Tool, select the relevant result line. Choose GO.
More Information
You can also view and modify properties during runtime in the SAP NetWeaver Administrator. More information: Java System Properties
Note
These tasks have to be done with extreme caution and only by users experienced in the SAP Logging API. More information: SAP Logging API
Prerequisites
Start the Config Tool by double-clicking the configtool script file in <SAP_install_dir>/<system_name>/<instance_name>/j2ee/configtool directory.
Procedure
Adding a New Controller
1. Choose
cluster
log configuration .
Recommendation
We recommend that you make your log configurations on instance level. 2. Select the categories or locations tab to create a new category or location, respectively. The new element is added as a sub-node inside the Root Category or Root Location tree structure. To add a new category/location in a particular position inside the tree structure, browse to that position and select the node under which the new category/location will be inserted. Then, continue with the next step. 3. Choose New and then enter a name for the new log controller. o Categories are named according to the hierarchical structure known from file systems. The different hierarchical levels in a category name must be separated by "/", For example, /System/Database (always starts with "/").
Locations are labeled according to the hierarchical structure known from Java packages. The "." character is used to demarcate the different layers in locations names. For example, com.sap.yourPackage.Class.
Note
If you have selected a particular node, the Name field displays a path to the selected node. Therefore, you only have to define the sub-name of your category/location at the end. 4. Choose OK. The new controller is added to the tree.
Editing a Controller
1. Select the controller you want to edit. 2. In Severity dropdown box, choose the level of severity. More information: Appendix A: Severity Levels
Note
If you change the severity of the root node or of a particular sub-tree, the change takes effect to all subnodes under the root one. 3. You can specify a destination where the log/trace messages to be written. To add one or more destinations, choose Add. Select a destination and then chooseOK. 4. To remove a destination, choose Remove. 5. Choose (Apply Changes).
6. To return the original configuration from the AS Java installation, choose Reset to Inherited Configuration.
Note
Trace messages for standard output for STDOUT and STDERR are written in the defaultTrace.trc file to the locations System.out and System.err, respectively. To be able to see these trace messages, you have to set the severity level of System.out to INFO, and the severity level of System.err to ERROR.
Removing a Controller
1. Select the controller you want to delete and choose Remove 2. Choose (Apply Changes).
Note
You can remove only log controllers created by you.
Prerequisites
Start the Config Tool by double-clicking the configtool script file in <SAP_install_dir>/<system_name>/<instance_name>/j2ee/configtool directory.
Procedure
Adding a New Destination
1. Choose
cluster
<template_name>/ <instance_number>
log configuration
destinations .
Recommendation
We recommend that you make your log configurations on instance level. 2. Choose any destination name from the tree and then choose New. A dialog box appears. 3. Enter a name for the new destination. It appears in the Destinations tree.
Editing a Destination
1. From Destinations tree, select the destination you want to edit. 2. Choose the Severity dropdown box to specify a severity level. More information: Appendix A: Severity Levels. 3. Choose Type dropdown list and select a destination type. The default ones are FileLog and ConsoleLog. 4. In case your destination is FileLog type, you can specify whether to be one file, or a rotating number of files. In the second case, use Count field to specify the number of files. Also, use the Limit field to define in bytes the size of a file from the rotation stack. 5. In Pattern field, specify the path to the file where messages will be written. 6. In Limit field, specify the maximum number of bytes each log file can contain.
7. In Formatter field, select a formatter. That is the format in which the log destination will print the messages. More information: Formatter 8. Choose (Apply Changes).
Removing a Destination
1. From Destinations tree, select the destination you want to delete. 2. Choose Remove. 3. Choose (Apply Changes).
Note
You can remove only destinations created by you.
Note
You can configure and manage formatters for existing logs (destinations) only.
Prerequisites
Start the Config Tool by double-clicking the configtool script file in <SAP_install_dir>/<system_name>/<instance_name>/j2ee/configtool directory.
Procedure
Adding a New Formatter
1. Choose
cluster
<template_name>/<instance_number>
log configuration
formatters .
Recommendation
We recommend that you make your log configurations on 2. Select any formatter from the tree and then choose New. A dialog box appears. 3. Enter a name for the new log formatter and then choose OK. The new formatter appears in the Formatters tree.
instance level.
Editing a Formatter
1. From Formatters tree, select the formatter you want to edit. 2. From Type dropdown box, choose the formatter type. The following are default ones: o ListFormatter formats log records that can be transferred to and processed further by another application (for example, by Log Viewer). o TraceFormatter formats log records in human readable format. You can specify a pattern to this format. If you do not specify such, the default one is created. o XMLFormatter formats log records as XML elements.
Note
For TraceFormatter you can make configuration, using a custom formatting pattern. The pattern enables you to specify the message data fields, with placeholders of the form %[[-]<width>[]]<type>. 4. Choose (Apply Changes).
Removing a Formatter
1. From Formatters tree, select the formatter you want to delete and choose Remove. 2. Choose (Apply Changes).
Note
You can remove only formatters created by you.
Caution
In several countries, the backup of security logs is enforced by law. Therefore, you must perform regular backups and keep all of your security log files.
Prerequisites
Start the Config Tool by double clicking the configtool script file in <SAP_install_dir>/<system_name>/<instance_name>/j2ee/configtool directory.
Procedure
1. Choose
cluster-data
<template name>
managers
LogManager.
2. From the list of properties, select ArchiveOldLogFiles. By default, log archiving is disabled and the value is set to OFF. 3. To activate the log files archiving, in Custom value field, set the value as ON. 4. Choose Set Custom Value to apply the new value. 5. To change the current log archive directory, choose the ArchivesDirectory property. The default directory where archives of logs are stored is: <Drive>:\usr\sap\<SID>\JC<Instance number>\j2ee\cluster\<server>\log\archive. 6. In Custom Value field, enter the name of the new directory. 7. Choose Set Custom Value. 8. If you want only certain log files to be archived, choose the ArchivedFileNames property. The default value for this property is empty. This means that all log files will be archived. 9. In the Custom Value field, enter the names of the files to be archived. The log file names have to be separated by semicolon (;). 10. Choose Set Custom Value. 11. Choose (Apply Changes).
Result
Log archiving is activated. To see the archived logs, use the Log Viewer tool.
Prerequisites
Start the Config Tool by double-clicking the configtool script file in <SAP_install_dir>/<system_name>/<instance_name>/j2ee/configtool directory.
Procedure
Exporting the System Configuration to an XML File
1. Choose
File
2. Choose the directory, where you want to save the XML file. 3. Enter a name for the XML file. 4. Choose OK.
File
Note
When you import a configuration, to be fully compatible it has to be previously exported from the Config Tool. 3. Choose Open.
Prerequisites
Make sure your AS Java is provided with the IAIK package. Make sure your JDK is provided with JCE Unlimited Strength Jurisdiction Policy Files by Sun Microsystems and they are installed on each used JRE. Start the Config Tool by double-clicking the configtool script file in <SAP_install_dir>/<system_name>/<instance_name>/j2ee/configtool directory.
Procedure
Encrypting the Secure Store
Note
To be allowed to enter a secure store key phrase, your AS Java needs to be stopped. 1. To manage the secure store, choose
cluster
Secure Store .
2. If the prerequisites are fulfilled, the Encrypt Store button is enabled. Choose it to encrypt the secure store content. 3. If your AS Java is stopped, in the dialog window, select the checkbox corresponding to AS Java is stopped. 4. Enter a key phrase for encrypting. You cannot change the default key file location. 5. Choose OK. 6. Choose (Apply Changes).
Dialog window Encrypting appears showing the encrypting progress bar. 7. When ready, a Logs window informs you about the success of the secure store migration and shows in which directory the secure store files are backed up.
Note
Every time you back up the secure store, the files are migrated in a directory whose name corresponds to the relevant time stamp.
Note
To be allowed to change your secure store key phrase, your AS Java needs to be stopped. 1. If the secure store content is already encrypted, choose the Change Key Phrase button.
2. Make sure that the AS Java is stopped checkbox is selected. 3. In the dialog window, enter the new key phrase. You cannot change the key file location. 4. Choose OK. 5. Choose (Apply Changes).
Removing a Property
1. Select a property. 2. Choose Remove. 3. Choose (Apply Changes).
Log Viewing
You can view all the logs and traces in AS Java using the following methods: Viewing all logs and traces from the whole SAP NetWeaver system landscape by taking advantage of all the filtering, searching, and customizing options available in the SAP NetWeaver Administrator. More information: Log Viewer Performing basic log viewing. More information: Log Viewing with the SAP MC Viewing all AS Java system log files in a command-line tool. More information: Command Line Log Viewer
Procedure
Viewing Developer Trace Files o To view the developer trace file of a process, select the relevant process and choose ShowDeveloper Trace from the context menu. o If the information in the developer trace is insufficient or too detailed, choose Increment/Decrement Trace Level to adjust the launcher trace level to the required level. Dumping the Java Stack Trace
To dump the server processes Java stack trace, select the relevant server process, and choose Dump Stack from the context menu.
To view the dump stack trace, choose Show Developer Trace (see above). The resulting Java server stack trace is stored in the dev_server<n> file in directory <Drive>:\usr\sap\<SAPSID>\<instance name>\work (Windows) /usr/sap/<SAPSID>/<instance name>/work (UNIX).
1.
Log Viewing from the SAP MC To view all the log and trace files of an instance, select the Log Files node from the tree
structure of the relevant instance. 2. In the navigation pane, select the file you want to view and choose Show Log File from the
context menu. 3. A dialog box appears, in which you can browse the log messages and view their detailed
description.
Note
Alternatively, you can view all developer trace and log files of an instance by selecting the relevant instance, and choosing List Developer Traces from the context menu. o To view the log file of the service, select an instance and choose Show Trace File from the context menu. o To view log records filtered by severity, time, and entries, select an instance and choose Analyze Log Files.
Note
Without a standard logging framework, developers are likely to use System.out.println in a sporadic manner or to call printStackTrace() in the case of an exception. Before executing the code in a productive system, the cleanup of these embedded lines can be very difficult. Therefore, this is not a flexible method to control the amount of log output, the destination, and the message format. In the SAP Logging API, the messages are separated in two main areas: Logging classical log messages, for distinguished problematic areas. Tracing classical trace messages, for coding problems.
Advantages
The availability and readability of logs or traces are very important for both developers and administrators. Therefore, a common logging framework must be made available to satisfy the requirements of these groups. This framework has the following advantages: Easy to use API - enabling logs is not a popular task for a developer. Therefore, the API/method calls have to be simple and intuitive. Performance - switching on the logging mechanism must not degrade the performance of the application as if running with logging. Easy to maintain - the log insertion done by developer is totally decoupled from executing the code.
Switching on or controlling the amount of log output is configurable at runtime without modifying the source code.
Implementation Considerations
If you want to define distinguished problematic logistic areas, you should focus on log messages. While, if you are interested in analyzing code problems, then trace messages are relevant. Enabling logging is a major task. What you have to do is classify the source area to be logged/traced, and then insert the output messages in the code.
Integration
The figure below represents a simplified version of the conceptual view that shows the key entities in the SAP Logging API. The terms used are described in the Key Components table after the figure.
Key Components
Term Log Manager Log Controller Log Record A structure that holds a message and its relevant data. Log Formatter Filter Represents the destination where the message should be output. Determines the format of the final message text. Optional means to further screen out messages. Description A module that manages the process of logging system events. The Log Manager is part of the Java Enterprise Runtime and is the first manager to be started at system startup. A Java object that manage the writing of log/trace messages.
Features
The SAP Logging API provides the following functionality: Using of both tracing and logging Making use of similarities between tracing and logging Cross-referencing between traces and logs
Language-independency for log messages Working with different output formats and destinations Controlled inheriting of code areas and message categories
LOG
Use This section contains the log commands used for AS Java log system administration. They are added to the Shell environment by executing ADD LOG on the command line. LOG_ARCHIVE Syntax Description LOG_ARCHIVE Creates archive for all log files.
LOG_CREATE Syntax Arguments -? | -H -C | -D | -F Displays the help message. Specifies the type of the object to be created: log controller (C), log destination (D), or log formatter (F). The ID of the object to be created. The OID identifier must represent a unique name for the Log Configurator Service. Creates and registers new objects into the Log_Configurator Service. LOG_CREATE [-? | -H] OID] [-C | -D | -F
OID
Description
Use the LOG_LIST command to obtain information about the existing objects. To change the settings of a newly created object you can use the LOG_EDIT command.
LOG_DUMPS Syntax Arguments -? | -H OID Displays the help message. The ID of the log controller to be debugged. The OID identifier must represent a valid name for the Log Configurator Service. Turns the additional console output ON or OFF. Enables or disables additional console output for a specified log controller. LOG_DUMPS [-? | -H] [OID] [ON | OFF]
ON | OFF Description
You can use the LOG_LIST command to obtain information about the existing controllers. Note that if this log controller already has an
associated log destination of type ConsoleLog some messages may be displayed twice. Keep in mind the hierarchy of the log controllers. If neither ON nor OFF is specified, then the current status is shown. If no OID is given a "global" configuration is assumed.
LOG_EDIT Syntax Arguments -? | -H -C | -D | -F Displays the help message. Specifies the type of the object to be edited: log controller (C), log destination (D), or log formatter (F). The ID of the object to be edited. The OID identifier must represent a valid name for the Log Configurator Service. Reconfigures previously registered objects in the Log Configurator Service. LOG_EDIT [-? | -H] [-C | -D | -F OID]
OID
Description
You can use the LOG_LIST command to retrieve the current logging settings or the LOG_CREATE command to add a new object to the existing configuration.
Note that only "named" objects can be edited (name is case sensitive), and that this operation will affect all the users of the corresponding object.
LOG_LIST Syntax Arguments -? | -H -C | -D | -F Displays the help message. Specifies the type of the object to be listed: log controller (C), log destination (D), or log formatter (F). Specifies that a thorough info should be provided. LOG_LIST [-? | -H] F [OID | -T]] [-T] [-C | -D | -
-T
The -T switch can be used as a single argument or after a type specifier (that is: -C, -D, or -F). In this case the command behaves as if there is no T (the only difference is that a detailed information will be provided for the appropriate objects, instead
of simple listing of their names). The object identifier, that is, the name of an object as printed by this command, displays a thorough information about the settings of a particular object. It must be used with a preceding type specifier but without the -T switch. The -T switch can be used only when no object ID is given. OID The ID of the object to be inspected. The OID identifier must represent a valid name for the Log Configurator Service. Shows information about the currently configured objects in the Log Configurator Service.
Description
Only "named" objects can be displayed (name is case sensitive). If the command is used without arguments, it provides a complete listing of all registered object names sorted by their corresponding types. If it is executed with a type specifier but with no object identifier, then this command lists the name of every object of the respective type that is configured with the Log Configurator Service
LOG_REMOVE Syntax Arguments -? | -H -C | -D | -F Displays the help message. Specifies the type of the object to be removed: log controller (C), log destination (D), or log formatter (F). The ID of the object to be removed. The OID identifier must represent a valid name for the Log Configurator Service. Removes previously configured objects from the Log Configurator Service. LOG_REMOVE [-? | -H] OID] [-C | -D | -F
OID
Description
You can use the LOG_LIST command to retrieve the necessary information. Note that only "named" objects can be removed (name is case sensitive), and that this operation will affect all the users of the corresponding object.