77
Inhalt Monitoring................................................ 3 History Reports........................................... 6 Managing Monitors with Monitor Browser....................7 Permanently Active Monitors...............................9 Activating and Deactivating Monitors.....................11 Protokolldateien überwachen und anzeigen.................12 Logging Features......................................... 16 Log (Destination)........................................ 19 Output File.............................................. 20 Appendix C: Default Behavior of Certain Objects..........22 Administrative Issues....................................25 Formatter................................................ 26 Log Configuration........................................ 29 Log Configuration with SAP NetWeaver Administrator.......30 GUI Config Tool.......................................... 32 Connecting to a Database.................................33 Configuring JVM Parameters...............................36 Configuring Instances....................................39 Adding and Removing Server Processes.....................41 Adding Filters........................................... 44 Configuring Shared Table.................................45 Modifying Service, Manager, or Application Properties....46 Adding, Editing and Removing Log Controllers.............50 Adding, Editing and Removing Log Destinations............52 Adding, Editing and Removing Log Formatters..............54 Configuring Log Files Archiving..........................56 Exporting and Importing a Configuration..................57 Managing Secure Store Data...............................58 Log Viewing.............................................. 60 Viewing Logs with the SAP Management Console.............61 SAP Logging API.......................................... 63

Monitoring

  • Upload
    kibir

  • View
    26

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Monitoring

InhaltMonitoring........................................................................................................................ 3

History Reports................................................................................................................. 6

Managing Monitors with Monitor Browser.......................................................................7

Permanently Active Monitors...........................................................................................9

Activating and Deactivating Monitors.............................................................................11

Protokolldateien überwachen und anzeigen..................................................................12

Logging Features.............................................................................................................16

Log (Destination).............................................................................................................19

Output File...................................................................................................................... 20

Appendix C: Default Behavior of Certain Objects............................................................22

Administrative Issues......................................................................................................25

Formatter........................................................................................................................26

Log Configuration............................................................................................................29

Log Configuration with SAP NetWeaver Administrator...................................................30

GUI Config Tool...............................................................................................................32

Connecting to a Database...............................................................................................33

Configuring JVM Parameters...........................................................................................36

Configuring Instances......................................................................................................39

Adding and Removing Server Processes..........................................................................41

Adding Filters.................................................................................................................. 44

Configuring Shared Table................................................................................................45

Modifying Service, Manager, or Application Properties..................................................46

Adding, Editing and Removing Log Controllers...............................................................50

Adding, Editing and Removing Log Destinations.............................................................52

Adding, Editing and Removing Log Formatters...............................................................54

Configuring Log Files Archiving........................................................................................56

Exporting and Importing a Configuration........................................................................57

Managing Secure Store Data...........................................................................................58

Log Viewing.....................................................................................................................60

Viewing Logs with the SAP Management Console..........................................................61

SAP Logging API...............................................................................................................63

LOG....................................................................................................................................66

Page 2: Monitoring

Monitoring

 Die Überwachung (Monitoring) des AS-Java-Systems soll dem Administrator helfen,

Ressourcenengpässe oder Probleme frühzeitig zu erkennen und gegebenenfalls einzugreifen.

Mit dem SAP NetWeaver Administrator können Sie den Anwendungsserver selbst sowie die auf ihm

laufenden Komponenten und Anwendungen überwachen. Sie können den Funktionsumfang Ihrer

eigenen Anwendungen erweitern, indem Sie Überwachungsfunktionen hinzufügen und somit die

Überwachungswerkzeuge und die Infrastruktur zur Überwachung Ihrer eigenen Anwendungen nutzen.

Außerdem können Sie auf Protokolldateien von einem einzigen Standort aus zugreifen und so den

zeitlichen Aufwand für die Identifikation von Fehlern und für Korrekturen reduzieren.

Lokales Monitoring

Java System Reports

Zur Überwachung Ihres lokalen Systems verwenden Sie das Werkzeug Java System Reports im SAP

NetWeaver Administrator.

Dieses Werkzeug zur Problemerkennung und -analyse können Sie folgendermaßen verwenden:

zur Überwachung von AS-Java-Cluster und Java-Anwendungen

zur Nachverfolgung der Systemleistung einer oder aller Instanzen und Cluster-Knoten eines

bestimmten Java-Systems

zur Ermittlung und Analyse der Problemursachen auf einem AS Java im Falle einer

eingeschränkten Systemleistung

zur Feinabstimmung für die produktive Verwendung mit dem AS Java

Die wichtigsten Informationen sind in einem Set vordefinierter Charts und Reports zusammengefasst.

Außerdem können Sie Daten von jedem einzelnen Monitor im Monitoring-Baum des Monitoring-

Browsers anzeigen und Ihre eigenen Reports und Charts zusammenstellen.

Weitere Informationen: Java System Reports

Protokolldateien überwachen und anzeigen

Für einen stabilen und fehlerfreien Betrieb des Systems muss der Systemadministrator die Protokolle

regelmäßig auf Fehlermeldungen prüfen. Wenn nötig, können Sie die

Standardprotokollierungseinstellungen so neu konfigurieren, dass sie optimal zu Ihrem Szenario

passen.

Weitere Informationen:

Protokolldateien überwachen und anzeigen

Log Viewing

Log Configuration

Page 3: Monitoring

Zentrales Monitoring

Wenn Sie SAP NetWeaver Process Integration 7.1 (PI) zentral überwachen möchten, müssen Sie die

zentrale SAP NetWeaver Administration für PI verwenden.

Weitere Informationen zur Konfiguration und Verwendung der SAP NetWeaver Administrator für PI

finden Sie unter PI-Monitoring mit dem SAP NetWeaver Administrator

Zusätzliche Überwachungsfunktionen

Bei Bedarf an bestimmten Überwachungsfunktionen bietet der SAP NetWeaver Administrator weitere

Werkzeuge.

Guided Procedures Monitoring

Der GP-Monitor stellt Ihnen umfassende Überwachungsfunktionen für das Guided-Procedures-

System und die dazugehörigen Anwendungen zur Verfügung und ermöglicht Ihnen so, alle

etwaigen Probleme ausfindig zu machen.

Der GP-Monitor ist ein Guided-Procedures-Plug-In für den SAP NetWeaver Administrator.

Weitere Informationen: Guided-Procedures-Monitor (GP-Monitor)

Open-SQL-Monitoring

Wenn Open SQL für Java für den Zugriff auf die Datenbank verwendet wird, ist es wichtig,

nachzuverfolgen, wie mit dem Persistenzspeicher umgegangen wird. Mit den Open-SQL-Monitoren

können Sie die Durchführung von SQL-Anweisungen, den Pufferstatus von Tabellen und

Katalogen sowie die Verfügbarkeit und Verwendung von Open-SQL-Datenbankverbindungen

überwachen.

Weitere Informationen: Open SQL Monitors

Message-Überwachung

Mit Hilfe des Message-Monitoring können Sie nach Web-Service-Messages suchen, die in Ihrem

System gesendet oder empfangen wurden. Sie können Messages überwachen, um den Status von

Web-Service-Messages nachzuverfolgen oder um aufgetretene Fehler aufzuspüren und ihre

Ursache festzustellen.

Weitere Informationen: Monitoring Messages

Sequenz-Monitoring

Mit Hilfe des Web Services Reliable Messaging (WS-RM) können Sie sicherstellen, dass die

Kommunikation zwischen einem Service-Provider und einem Service-Customer fehlerfrei

abgeschlossen wird. Sie verwenden die Analysewerkzeuge des Sequenz-Monitors zum Aufspüren

solcher Fehler. Mit Hilfe des Sequenz-Monitors können Sie beispielsweise seinen Status anzeigen

oder fehlerhafte Sequenzen stoppen oder erneut starten.

Weitere Informationen: Sequenzen überwachen

Archivierungsmonitoring

Page 4: Monitoring

Dieser Bereich ist Teil der Funktion des Java Archiving Cockpit. Hier können Sie den Fortschritt der

Archivierung überwachen und Statistiken darüber anzeigen, wie viele Objekte geschrieben oder

gelöscht wurden und von wem.

Weitere Informationen:

Java Archiving Cockpit

Archiving Monitor

Page 5: Monitoring

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.

Starting History Reports

To start the tool, in the SAP NetWeaver Administrator, choose   Availability and Performance   

Resource Monitoring   History Reports  .

Alternatively, you can use the quick link /nwa/java-sys-reports .

Page 6: Monitoring

Managing Monitors with Monitor Browser

 Monitor Browser is available as a predefined report inside History Reports and provides runtime

control for displaying monitored data. The monitored resources and their attributes are displayed in a

table.

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   (OK) if data is at normal level and no attention is needed.

System displays   (Warning) if data values are moved to the next alert level and some problems

can occur soon. Attention is needed.

System displays   (Alert) if data values are moved to the error level. Special measures must be

taken.

System displays   (Inactive) if the monitor is a non-performance one and/or is not working. If no

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   Availability and Performance   

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.

Page 7: Monitoring

Activating and Deactivating Monitors

The concept of active and inactive monitors allows you to activate only the monitors that you need and

to deactivate the other ones, for improving the overall performance of the system.

More information about default activated monitors: Monitors Active by Default

More information:  Activating and Deactivating Monitors

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

Page 8: Monitoring

Permanently Active Monitors

 The following table contain all monitors with state Used. They cannot be deactivated on the server

processes since they participate in History Reports.

FeaturesMonitors with “Used” State

Monitor Monitor

Type

Kernel/Application Threads Pool/Usage Rate Integer

Kernel/Cluster Manager/MessageContext Communication/ General (MessageContext)/Average

MS Process Time

Integer

Kernel/Cluster Manager/SessionContext Communication/ General (SessionContext)/Average

Session Process Time

Integer

Kernel/Session Manager/Active Web Sessions Count Integer

Kernel/Session Manager/Logged-in Users Count Integer

Kernel/Session Manager/Opened EJB Sessions Count Integer

Kernel/Session Manager/Opened Security Sessions Count Integer

Kernel/Session Manager/Opened Web Sessions Count Integer

Kernel/System Threads Pool/Usage Rate Integer

Services/Http Provider/General/AllRequestsCount Long

Services/JMS/Num of not started VPs/Not Started Virtual Providers Count Integer

Services/Keystore/System Entries State

Services/Keystore/User Entries State

Services/Log Configurator/General/TotalLogFileSize Long

Services/Log Configurator/Messages/All Long

Services/Log Configurator/Messages/Error Long

Services/Log Configurator/Messages/Fatal Long

Services/Log Configurator/Messages/Warning Long

Services/Memory Info/Allocated Memory Integer

Services/Memory Info/Available Memory Integer

Services/Security/Aggregated Data/UnsuccessfulLogonAttemptsCount Long

Services/Security/Data Per Application/SAP-J2EE-Engine/ UnsuccessfulLogonAttemptsCount Long

Page 9: Monitoring

Monitors with “Used” State

Monitor Monitor

Type

Services/Security/Data Per Application/sap.com/com.sap.lcrsld/ UnsuccessfulLogonAttemptsCount Long

Services/Security/Data Per Application/sap.com/tc~dtr~enterpriseappdtr/

UnsuccessfulLogonAttemptsCount

Long

Services/Security/Data Per Application/sap.com/

tc~lm~itsam~ui~mainframe~wdwebdynpro_resources_sap.com_tc~lm~itsam~ui~

mainframe~wd/UnsuccessfulLogonAttemptsCount

Long

Services/Security/Data Per Application/service.naming/ UnsuccessfulLogonAttemptsCount Long

Services/Security/Data Per Application/ticket/ UnsuccessfulLogonAttemptsCount Long

Services/Timeout/EstimatedFrequencyPerMinute Integer

Services/Web Container/ AverageProcessingTime Duration

Page 10: Monitoring

Activating and Deactivating Monitors

 Inactive monitors have no history and do not pool data from the monitored resources automatically.

These monitors can retrieve information only on demand.

Deactivation of unused monitors minimizes the impact of the monitoring service on the CPU and

memory consumption. It also reduces the monitoring history by not storing history for monitors that are

rarely used.

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.

 NoteYou 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.

Page 11: Monitoring

Protokolldateien überwachen und anzeigen

 Protokoll- und Trace-Sätze enthalten Informationen über die Systemausführung.

Protokollsätze werden hauptsächlich von Administratoren für das Überwachen der Systemaktivität

und dem Ausführen von Fehleranalysen verwendet. Protokolle werden gewöhnlich in Kategorien

geschrieben.

Trace-Sätze werden in der Regel von Entwicklern und Servicetechnikern für das Aufzeichnen und

Analysieren der Vorkommnisse von bestimmten Programmereignissen während der Laufzeit

verwendet. Traces werden normalerweise in Lokationen geschrieben.

Weitere Informationen: Logging Features

Konfiguration

Die nachfolgende Tabelle enthält Konfigurationseinstellungen, die Sie festlegen können, wenn die

Standardeinstellungen nicht geeignet sind:

Konfigurationsaufgabe Beschreibung

Log-Controller-Severities

konfigurieren

Sie verwenden das Werkzeug Log Configuration im SAP NetWeaver

Administrator.

Die Standardwerte für den Schweregrad sind:

für Kategorien – INFO

für Standorte – FEHLER

Weitere Informationen: Log Configuration with SAP NetWeaver Administrator

Speicherung von Traces

konfigurieren

Sie können den Speicherort für Trace-Dateien konfigurieren, indem Sie den Log

Manager verwenden.

Weitere Informationen: Log Manager

Archivierung ein- bzw.

ausschalten

Die Protokoll-und Trace-Archivierung ist standardmäßig ausgeschaltet. Sie

können Sie einschalten, den Archivierungsspeicherort konfigurieren und

angeben, welche Dateien archiviert werden sollen.

Weitere Informationen: Configuring Log Files Archiving

Aufgaben

Die nachfolgende Tabelle enthält Aufgaben, die Sie bei Bedarf durchführen können:

Aufgabe Beschreibung

Protokolle bei

laufendem AS Java

filtern und anzeigen

In jeder vordefinierten Sicht oder benutzerdefinierten Sicht können Sie Protokoll- und

Trace-Sätze von AS Java nach einem bestimmten Kriterium filtern und anzeigen.

Weitere Informationen: Filtering Logs and Traces

Page 12: Monitoring

Aufgabe Beschreibung

Protokolle bei nicht

laufendem AS Java

filtern und anzeigen

Wenn kein AS Java auf dem zu überwachenden System läuft, können Sie Protokoll- und

Trace-Sätze mithilfe eines entfernten Log Viewer filtern und anzeigen.

Weitere Informationen: Connecting to a Remote System

Protokollsätze mit

Schweregrad

ERROR oder FATAL

anzeigen

Um die SAP NetWeaver-Systemlandschaft auf kritische Zustände hin in jeder beliebigen

vordefinierten oder benutzerspezifischen Sicht zu überwachen, können Sie nur die

Protokoll- und Trace-Sätze mit Schweregrad ERROR oder FATAL herausfiltern und

anzeigen.

Protokolldateien

löschen

Sie können Protokolldateien auf drei Arten löschen:

Automatisch – Wenn die Protokolle die Größe von fünf Dateien mit jeweils 10 MB

erreichen, fangen die neuen Protokolle an, die alten Protokolle zu überschreiben, die

somit automatisch gelöscht werden.

Wenn Sie die Archivierung aktivieren, erstellt das System eine Sicherungskopie im

ZIP-Format vom Set der fünf Dateien und fängt an, die erste Protokolldatei zu

überschreiben.

Sie können manuell den Teil der Protokoll- oder Trace-Dateien löschen, den Sie

nicht benötigen – z.B. die Standard-Traces.

 Achtung

In einigen Ländern ist das Erstellen von Sicherungskopien der Sicherheitsprotokolle

per Gesetz vorgeschrieben. Aus diesem Grund müssen Sie regelmäßig

Sicherungskopien von Ihren Sicherheitsprotokolldateien anfertigen und

aufbewahren.

Sie können jene temporären Protokoll- und Trace-Dateien löschen, 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 temporäre

Unterverzeichnis ./log/archive/temp extrahiert.

Die Protokoll- und Trace-Dateien werden anschließend nicht aus diesem temporären

Verzeichnis gelöscht. Beim nächsten Mal werden die Archive daher schneller

angezeigt.

 Empfehlung

Sie sollten diese Protokoll- und Trace-Dateien regelmäßig löschen, um Plattenplatz

freizumachen.

Page 13: Monitoring

Aufgabe Beschreibung

Größe von Protokoll-

und Trace-Dateien

überwachen

Es gibt zwei Arten der Überwachung für Protokolle und Traces – für die Datei- und die

Archivierungsgröße. Weitere Informationen: Log Configurator

Sie können auch die Einstellungen der Überwachungsampel ändern – z.B. den Wert,

wenn die Überwachungsampel von gelb auf grün wechselt. Verwenden Sie dafür

den Monitor Browser in SAP NetWeaver Administrator. Weitere Informationen:Monitor

Browser

Werkzeuge

Mit dem Werkzeug Log Viewer in SAP NetWeaver Administrator können Sie alle als Liste oder Text

formatierten Protokolle und Traces anzeigen, die innerhalb der gesamten SAP NetWeaver-

Systemlandschaft erzeugt werden.

Sie können 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\

cluster\<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

Zusätzlich stehen die folgenden speziellen AS-Java-Log-Controller zur Verfügung:

AS-Java-Komponente Protokoll-Kategorie Trace-Lokation

AS Java allgemein /System

Business Process Management /Applications/

BPM/Runtime

com.sap.glx

Composite Application

Framework

/Applications com.sap.caf

com.sap.caf.rt

com.sap.caf.ui

com.sap.caf.runtime.ui.configurat

ion

Page 14: Monitoring

AS-Java-Komponente Protokoll-Kategorie Trace-Lokation

Guided Procedures /Server com.sap.caf.eu.gp.*

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 XML-

Scripts (Generic Creator)

6. Probleme bei

Berechtigungen/Sicherheit

7. Probleme beim

Deployment von Content

8. Probleme bei der

Darstellung von Seiten

/System/Server 1. com.sap.portal.adminstudio

com.sap.portal.admin.adminstu

dio

2. com.sap.portal.OBN

3. com.sap.portal.connectors

4. com.sap.portal.fpn

5. com.sap.portal.ivs.genericCre

ator

6. com.sap.portal.pcd

com.sapportals.portal.securit

y

7. com.sap.portal.prt.sapj2ee

8. com.sap.portal.pb

Zusammensetzung von

Services

/Applications com.sap.sa.rt*

Visual Composer /Server com.sap.vc.server05

Web-Services /System/Server/

WS

com.sap.engine.services.webservic

es

Page 15: Monitoring

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.

Page 16: Monitoring

Control of the Output

To control the log output, you need a log controller. It is a Java object that manages the writing of log

and trace messages. Two types of log controllers are available:

Category — describes messages specific to distinguished problem areas. It is used to emit log

messages. Typical problem areas are: databases, networking, security auditing, and others.

Location — describes messages that originate from delimited source code areas. It is used to

emit trace messages.

Log and trace messages are written in destinations, also known as logs. Destinations are predefined

by the SAP Logging API. Each log destination type can print messages in the following

formats: TraceFormatter, XMLFormatter, and ListFormatter.

More information: Log (Destination) and Formatter

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.

 NoteLog 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.

Page 17: Monitoring

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

Page 18: Monitoring

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.

 NoteTo 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.

Page 19: Monitoring

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.

Placeholde

r

Description Comments

/ Local file name

separator.

"C:\temp\trace.log == ""C:/temp/trace.log"

%h Home directory. The value of the system property:"user.home"

%t System temporary

directory.

The value of the system property: java.io.tmpdir"". Normally, it is "C:\

temp". Therefore:"C:\temp\trace.log" == "%t/trace.log"

%u A number that

makes the file

name unique.

To avoid file naming conflicts.

%% The percentage

sign.

Page 20: Monitoring

Placeholde

r

Description Comments

%g The sequence

number of the file.

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".

Output File Sequence and Rotation

This is done implicitly when you specify values for the file size (in bytes) and the cap for the

sequencing count, before rotating back to the first file. This pair of parameters must coexist together -

either they both have values assigned, or both have values equal to zero. Otherwise, depending on

the option you use to do the configuration, either an exception can be thrown (through the API), or

"best guess" values are used (through the configuration file). For example, both attributes get default

zero values.

More information: Administrative Issues.

This can be done when the FileLog constructor is called.

 Syntax1. FileLog _file = new FileLog("%t/trace.%g.log", 800000, 10, new

TraceFormatter());

In case of the configuration file, the syntax is:

 Syntax1. log[File] = FileLog2. log[File].pattern = %t/trace.%g.log3. log[File].limit = 8000004. log[File].cnt = 105. log[File].formatter = 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".

FileLog or Physical File

FileLog is a logical representation of a physical output file where messages are directed. With the

several configuration options mentioned in the previous section, you can manipulate the output

behavior of the output file through the API of the FileLog. You can also do assignments of

the FileLog to source objects.

Page 21: Monitoring

1:1 Recommended

The FileLog and the actual output file must be in a 1:1 relationship.

 RecommendationWe 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.

Page 22: Monitoring

Appendix C: Default Behavior of Certain Objects

 Default Attributes Values

Class Attribute Default Value Description

LogController Severity Severity.NONE No output at all.

MinSeverit

y

Severity.ALL No floor restriction: output all.

MaxSeveri

ty

Severity.NONE No ceiling restriction: output nothing.

<output

logs>

<none> No output at all.

<filters> <none> No further filtering.

Log Severity Severity.ALL Do not further suppress messages.

<filters> <none> No further filtering.

ConsoleLog Formatter TraceFormatter

FileLog Formatter ListFormatter

Limit 0 No file size limit. 'Count' must == 0. No rotating set of

numbered files.

Count 0 Log file name generated without a sequence number.

TraceFormatt

er

Pattern %24d %-40l [%t]

%s: %m

Example:

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#

Page 23: Monitoring

Class Attribute Default Value Description

XMLFormatte

r

Pattern <!ELEMENT log

(record*)><!

ELEMENT table

(id, time,

source,

severity,

location,

thread, msg-

type, msg-code?,

bundle?, msg-

clear?,

args?)><!ELEMENT

id (#PCDATA)><!

ELEMENT time

(#PCDATA)><!

ELEMENT source

(#PCDATA)><!

ELEMENT severity

(#PCDATA)><!

ELEMENT location

(#PCDATA)><!

ELEMENT thread

(#PCDATA)><!

ELEMENT msg-type

(#PCDATA)><!

ELEMENT msg-code

(#PCDATA)><!

ELEMENT bundle

(#PCDATA)><!

ELEMENT msg-

clear

(#PCDATA)><!

ELEMENT args

(arg+)><!ELEMENT

arg (#PCDATA)>

Example:

<record>

<id>10.48.27.165:4A5AB2:E99D2EDAFF: -

8000</id> <time>Mon Jan 01 22:00:00

PDT 2001 </time>

<source>com.sapmarkets.FooClass</sour

ce>

<location>com.sapmarkets.FooClass.foo

Method </location>

<thread>main</thread>

<severity>Fatal</severity> <msg-

type>Plain</msg-type> <msg-clear>A

sample fatal message</msg-clear>

</record>

Page 24: Monitoring

Highlights of Default Behavior

Class Property Default Value Description

Location root name "" Empty string. Full name should be

hierarchical, delimited by "." .

Category root name "/" Similar to root directory. Full name should

be hierarchical, delimited by "/".

FileLog Filename, with

size limit and

count

<filename>.cnt.<ext> For example: trace.0.log, trace.1.log

Trace Filename, if not

specified by

user

%t/trace.log For example, C:\temp\trace.log .

TraceFormatter Message

displayed

Content of 'MsgClear' in

any case.

Either translated text in 'MsgClear' or

text provided by users explicitly in

'MsgClear'.

ListFormatter Message

displayed

Optional Both MsgCode & MsgClear available,

up to the viewer.

XMLFormatter Message

displayed

Optional Both MsgCode & MsgClear available,

up to the viewer.

Location or

Category with

relative 'A'

OutputBehavior

by relative

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.

Page 25: Monitoring

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.

 ExampleFor 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.

Page 26: Monitoring

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.

The table below describes the meaning of the placeholders:

Placeholde

r

Description

%d Timestamp in readable form.

%l The location of origin (for example, com.sapmarkets.FooClass.fooMethod).

%c The log controller through which the message is issued (for

example, com.sapmarkets.FooClass).

%t The thread that emits the message.

%s The message severity.

%m The formatted message text.

%I The Message ID.

%p The time stamp in milliseconds (for example, since January 1, 1970 00:00:00 GMT).

%g The group identification.

Page 27: Monitoring

XMLFormatter

Suitable for file transfer to be further processed in other applications.

 Syntax1. <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:

 Syntax1. <!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 Version (of the ListFormatter)

o Message ID

o Timestamp

Page 28: Monitoring

o Source name (log controller)

o Thread ID

o Location name (the actual code location that generates the message)

o Group indentation

o Message severity

o Message Type (PLAIN or JAVA)

o Message Code

o ResourceBundle name

o Message

o Number of arguments

o Arguments

Page 29: Monitoring

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

Page 30: Monitoring

Log Configuration with SAP NetWeaver Administrator

Log Configuration provides options for online configuring the severities of log controllers in the whole

system or in a certain system instance.

To access the tool, open SAP NetWeaver Administrator and then choose   Troubleshooting   

Logs and Traces   Log Configuration  .

You can alternatively use the quick link: http://<host>:<port>/nwa/log-config.

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.

 NoteThe 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.

Page 31: Monitoring

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

Page 32: Monitoring

GUI Config Tool

 Use the GUI Config Tool to offline configure AS Java via graphical UI.

You can use simple and expert mode for configurations.

To start GUI Config Tool, double-click the configtool script file

in <SAP_install_dir>/<system_name>/<instance_name>/j2ee/configtool directory.

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

Page 33: Monitoring

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.

 NoteIf 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

Description Example

Secure

Store File

Contains the path to the

secure store properties

file. This file is encrypted

for security reasons.

C:\usr\sap\LKG\SYS\global\security\data\

SecStore.properties

Secure

Store Key

File

Contains the path to the

secure store key file. The

key file contains the

password for the

encrypted store file.

C:\usr\sap\LKG\SYS\global\security\data\

SecStore.key

System

Name

Displays the name of the

system to which this data

applies.

LKG

Page 34: Monitoring

Secure

Store Lib

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

Connectio

ns

A property key, by which

the value contains the DB

connection settings.

jdbc/pool/LKG

Direct

Login

Settings

Description Example

RDBMS

URL

Specifies the URL for the

database connection in

the correct format for the

corresponding driver.

jdbc:sapdb://sofD60163517A/CE1?

timeout=0&spaceoption=true&unicode=true

Driver

name

Specifies the class name

of the JDBC driver to be

used for database

connections.

com.sap.dbtech.jdbc.DriverSapDB

RDBMS

user

Specifies the user name

for this database

connection.

SAPLKGDB

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.

;C:\usr\sap\LKG\SYS\global\security\lib\tools\

iaik_jce.jar; C:\usr\sap\LKG\SYS\global\

security\lib\tools\iaik_jsse.jar; C:\usr\sap\

LKG\SYS\global\security\lib\tools\

iaik_smime.jar; C:\usr\sap\LKG\SYS\global\

security\lib\tools\iaik_ssl.jar

General

Settings

Description Example

RDBMS

Driver

Location

Contains the path to the

RDBMS driver.

C:\\sapdb\programs\runtime\jar\sapdbc.jar

Page 35: Monitoring

RDBMS

Initial

Connectio

ns

Specifies the number of

database connections to

be created initially in the

connection pool.

1

RDBMS

Maximum

Connectio

ns

Specifies the maximum

number of database

connections to be kept in

the connection pool.

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   View   Startup

Options.  . Then, in the dialog window, check Show connection dialog.

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   View   Startup Options  . Then, in the

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.

 NoteIf 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.

Page 36: Monitoring

Configuring JVM Parameters

 This procedure enables you to view and edit the Java Virtual Machine (JVM) parameters using Config

Tool. The JVM is used for running the AS Java and all deployed applications. You can change values

in the configuration template or for a specific instance.

If you want your settings to be valid for all instances, make the configurations on a template level.

The template configuration is valid for those instances that do not have custom configuration.

 NoteYou 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.

 CautionAvoid 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.

Configuring JVM Parameters on Template Level

1. Select the template.

2. Choose   View   Expert Mode  .

Page 37: Monitoring

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.

 RecommendationWe 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

 RecommendationIf 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:

 Examplekey="-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.

Page 38: Monitoring

9. Choose Set.

10. Choose   (Apply Changes).

11. In order the changes to take effect, restart AS Java.

Configuring JVM Parameters on Instance Level

1. Choose the instance you want to configure.

2. Select VM Parameters.

3. From the table below, choose the relevant parameter.

4. Enter the new value in the Custom Value field.

5. To enable/disable a parameter from the Custom Parameters table, choose the parameter and

then select Enable/Disable.

 NoteFor more advanced tasks (for example, to use a different “vendor-platform” combination),

choose   View   Expert Mode   and then go to VM Type.

6. Choose Set.

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.

Adding New JVM Parameters

1. Choose the template or the instance you want to configure.

 NoteTo add VM parameters on a template level, choose   View   Expert Mode  .

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 Enter a name as required.

o Optional: enter a value and description.

4. To add a custom parameter, choose Additional

o Select a VM parameter from the list.

o Optional: enter a value if the Value field is available

o 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).

7. In order the changes to take effect, restart AS Java.

Page 39: Monitoring

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

Viewing and Editing the JVM Settings for a Specific Instance

More information: Configuring JVM Parameters

Enabling and Disabling an Instance

1. From the tree structure, select the instance you want to configure.

2. Select VM Environment.

3. Select the Execute property.

The value is set to true by default. Its function is to automatically start the specified instance

during runtime of AS Java.

4. In Custom value, enter false.

5. Choose   (Apply Changes).

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.

Viewing or Editing the Debug Properties for an Instance

1. From the tree structure, select the instance you want to configure.

2. Choose   VM Environment   Custom value  .

3. Enter the new value of the following settings:

o Debuggable – the debug mode feature for the selected instance is enabled.

o DebugMode – specifies whether the instance is in debug mode and if the debug port is

open.

Page 40: Monitoring

 NoteWhen you enable debug mode for an instance, first make sure you have stopped all

message-driven beans running on that instance.

 NoteIn 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).

Viewing Instance Profile Constants

1. From the tree structure, select the instance you want to configure.

2. Select the Instance Profile tab and see information such as system name, instance name,

instance number, operation system name, and so on.

Page 41: Monitoring

Adding and Removing Server Processes

 The installation procedure configures the optimal number of server processes in an instance based on

the available hardware resources. This enables optimal utilization of the hardware resources and of

the capacity of the ICM to handle multiple server processes.

 NoteWhen 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.

Page 42: Monitoring

Prerequisites

You have installed the basic components of the cluster.

Make sure the AS Java is stopped.

More information: Starting and Stopping Systems and Instances.

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.

 NoteThis option is available at instance level only.

Page 43: Monitoring

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.

 NoteYou 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).

9. In order the changes to take effect, restart AS Java.

Page 44: Monitoring

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.

 NoteYou 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).

Page 45: Monitoring

Configuring Shared Table

 The shared table of an Java instance stores monitoring information about applications, browser

sessions, Web sessions, processes, EJBs and so on.

You can configure this shared table via particular properties. They are represented as tables in the

SAP Management Console. This procedure enables you to change the number of the relevant table's

rows.

For example, you can change the number of concurrently supported active Java applications, Java

processes, threads, EJB sessions and so on.

 NoteIf 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.

 RecommendationWe 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).

9. In order the changes to take effect, restart the cluster.

Page 46: Monitoring

Modifying Service, Manager, or Application Properties

 This procedure enables you to change the properties of a particular service, manager, or application,

using the Config Tool.

When you select a service, manager or an application, its relevant property keys and values are

displayed in a table on the right.

The properties in the template configuration are divided into two sections:

Default property data

Displays default template configuration settings for a manager or service. These settings cannot be

changed.

Custom property data

If you want to add custom values for a property, they are displayed in the Custom property

data field.

If you make this change on a template level, these settings are valid for all instances.

 NoteThe 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 (/).

 NoteYou can view and modify nested properties in Expert Mode only.

Page 47: Monitoring

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).

Setting a Custom Value for a Specific Instance

1. Open an instance configuration.

2. Select a service, manager or an application.

3. Select the property you want to configure.

4. In Custom value, enter a new value.

5. Choose Set Custom Value.

6. Choose   (Apply Changes).

Restoring to Default Value

1. Open the template or an instance configuration.

2. Select the property whose value you want to restore.

3. Choose Restore to Default Value or Restore to Inherited Value, respectively.

The custom value is restored to its default value.

Modifying Nested Properties

1. Choose   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.

Page 48: Monitoring

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:

 Syntax1. ReverseProxyMappings2. ProxyConfigurations3. Proxy14. HttpProxyPort=805. Header6. 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 In the field Value, enter a value for the property key.

o Optional: You can enter a description for the property.

6. To delete a nested property, select it and then choose Remove.

 CautionOnly 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).

Overwriting Instance Properties Values

Use this procedure if you have set custom values on instance level and you want to overwrite them

with template ones.

1. Choose the template configuration.

2. Choose the relevant application, manager or a service.

3. Select the property whose instance value you want to reset.

4. In the Custom Value field, enter the new template value.

5. Choose Set Custom Value.

 NoteYou 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.

Page 49: Monitoring

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.

Searching for Properties

1. To find a particular property, choose   (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

Page 50: Monitoring

Adding, Editing and Removing Log Controllers

 Log controller is a Java object that manages the writing of log and trace messages.

Two types of controllers are available:

Location - describes messages that originate from source code areas, and is used to emit trace

messages.

Category - describes messages specific to distinguished problem areas, and is used to emit log

messages. Typical problem areas are databases, networking, security auditing, and others.

This procedure helps you manage your log categories and trace locations.

The configuration steps are one and the same for both categories and locations. That is, the steps

below are described for log controllers as a whole.

 NoteThese 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   <template_name> / <instance number>   log configuration  .

 RecommendationWe 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 "/").

Page 51: Monitoring

o 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.

 NoteIf 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

 NoteIf 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.

 NoteTrace 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).

 NoteYou can remove only log controllers created by you.

Page 52: Monitoring

Adding, Editing and Removing Log Destinations

 This procedure helps you manage the destinations where you want your log messages to be written.

The log destination is also the object, to which you specify and assign a formatter, as well as optional

filters.

More information: Log (Destination)

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  .

 RecommendationWe 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.

Page 53: Monitoring

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).

 NoteYou can remove only destinations created by you.

Page 54: Monitoring

Adding, Editing and Removing Log Formatters

 Each log type can print messages in different formats: TraceFormatter, XMLFormatter,

and ListFormatter. This procedure helps you manage the log formatters.

More information: Formatter

 NoteYou 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  .

 RecommendationWe recommend that you make your log configurations on instance level.

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.

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.

3. Choose Pattern field to configure the formatter.

 Note

Page 55: Monitoring

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).

 NoteYou can remove only formatters created by you.

Page 56: Monitoring

Configuring Log Files Archiving

 Use this procedure to configure automatic archiving of AS Java log files.

Logs are written into five files, each file with a maximum size of 10 MB. When the fifth file is

completed, the new logs start overwriting the old log files.

If you enable the archiving process, the set of five full files is converted into a ZIP file and stored as an

archive on the file system. After the ZIP file is done, the new logs keep on overwriting the old log files.

 CautionIn 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.

Page 57: Monitoring

Exporting and Importing a Configuration

 You can save the changes you have made in the system configuration by exporting them as an XML

file. You can also export AS Java data from the database and import it later. Thus you can restore the

settings of the cluster components' properties.

This procedure enables you to export the whole cluster data as well as a particular cluster component

data, or just the instance “.properties” file.

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   Export Unsaved Changes to XML  .

2. Choose the directory, where you want to save the XML file.

3. Enter a name for the XML file.

4. Choose OK.

Importing Data for a Particular Element

1. Choose   File   Restore From Backup  .

2. Select the file you want to import.

 NoteWhen you import a configuration, to be fully compatible it has to be previously exported from the

Config Tool.

3. Choose Open.

Page 58: Monitoring

Managing Secure Store Data

 This procedure enables you to administer the secure store data of the AS Java system. You can also

provide additional encryption of the secure store content.

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

 NoteTo 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.

 NoteEvery time you back up the secure store, the files are migrated in a directory whose name

corresponds to the relevant time stamp.

Changing a Key Phrase

 NoteTo 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.

Page 59: Monitoring

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).

Editing the Secure Store Data

1. Choose Connection Pools.

2. Select a property and edit its value.

3. If you want to add another property, choose Add.

4. Enter the relevant key and value.

5. Choose   (Apply Changes).

Removing a Property

1. Select a property.

2. Choose Remove.

3. Choose   (Apply Changes).

Page 60: Monitoring

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

Page 61: Monitoring

Viewing Logs with the SAP Management Console

 The trace and log messages contain important information about system operation. It is helpful to

check and analyze them if you experience errors or unexpected behavior.

Using the SAP Management Console (SAP MC) log viewing functions you can:

View all system log and trace files

View developer trace files

Create stack traces for the processes

Types of Log and Trace Files

Instance developer trace and log files contain information about the startup process. You can

check these files in case of errors or unexpected behavior during the startup process. The data

from the last three restarts is retained by default.

o The developer trace files of the Java instance are located in directory <Drive>:\usr\sap\

<SAPSID>\<instance name>\work (Windows) /usr/sap/<SAPSID>/<instance

name>/work (UNIX), where <SAPSID> is the system ID (for example, CE1) and<instance

name> is the instance name of the Java instance (for example, J03).

o The developer trace files of the central services instance are located in directory <Drive>:\

usr\sap\<SAPSID>\<instance name>\

work (Windows) /usr/sap/<SAPSID>/<instance name>/work (UNIX) ,

where <SAPSID> is the SAP system ID (for example,CE1) and <instance name> is the

instance name of the central services instance (for example, SCS02).

AS Java logs The log and trace files generated by the AS Java processes and the applications

running on top of AS Java are stored in directory <Drive>:\usr\sap\<SAPSID>\<instance

name>\j2ee\cluster\server<n>\log (Windows)/usr/sap/<SAPSID>/<instance

name>/j2ee/cluster/server<n>/log (UNIX).

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

Page 62: Monitoring

o To dump the server processes Java stack trace, select the relevant server process, and

choose Dump Stack from the context menu.

o 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).

Log Viewing from the SAP MC

1. 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.

 NoteAlternatively, 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.

Page 63: Monitoring

SAP Logging API

 During the development phase, it is common practice to insert logging statement within the code to

produce informative logs at runtime, whether for troubleshooting or for analysis purposes.

 NoteWithout 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.

Page 64: Monitoring

The terms used are described in the Key Components table after the figure.

Conceptual View of SAP Logging Tool

Key Components

Term Description

Log

Manager

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.

Log

Controller

A Java object that manage the writing of log/trace messages.

Log Record A structure that holds a message and its relevant data.

Log Represents the destination where the message should be output.

Formatter Determines the format of the final message text.

Filter Optional means to further screen out messages.

Features

The SAP Logging API provides the following functionality:

Using of both tracing and logging

Making use of similarities between tracing and logging

Page 65: Monitoring

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

Page 66: Monitoring

 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 LOG_ARCHIVE

Description Creates archive for all log files.

 

LOG_CREATE

Syntax LOG_CREATE [-? | -H]  [-C | -D | -F OID]

Arguments  

-? | -H Displays the help message.

-C | -D | -F Specifies the type of the object to be created: log controller (C), log destination (D), or log formatter (F).

OID The ID of the object to be created. The OID identifier must represent a unique name for the Log Configurator Service.

Description Creates and registers new objects into the Log_Configurator Service.

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 LOG_DUMPS [-? | -H]  [OID]  [ON | OFF]

Arguments  

-? | -H Displays the help message.

OID The ID of the log controller to be debugged. The OID identifier must represent a valid name for the Log Configurator Service.

ON | OFF Turns the additional console output ON or OFF.

Description Enables or disables additional console output for a specified log controller.

You can use the LOG_LIST command to obtain information about the existing controllers.

Note that if this log controller already has an

Page 67: Monitoring

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 LOG_EDIT [-? | -H]  [-C | -D | -F OID]

Arguments  

-? | -H Displays the help message.

-C | -D | -F Specifies the type of the object to be edited: log controller (C), log destination (D), or log formatter (F).

OID The ID of the object to be edited. The OID identifier must represent a valid name for the Log Configurator Service.

Description Reconfigures previously registered objects in the Log Configurator Service.

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 LOG_LIST [-? | -H]  [-T]  [-C | -D | -F [OID | -T]]

Arguments  

-? | -H Displays the help message.

-C | -D | -F Specifies the type of the object to be listed: log controller (C), log destination (D), or log formatter (F).

-T Specifies that a thorough info should be provided.

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

Page 68: Monitoring

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.

Description Shows information about the currently configured objects in the Log Configurator Service.

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 LOG_REMOVE [-? | -H]  [-C | -D | -F OID]

Arguments  

-? | -H Displays the help message.

-C | -D | -F Specifies the type of the object to be removed: log controller (C), log destination (D), or log formatter (F).

OID The ID of the object to be removed. The OID identifier must represent a valid name for the Log Configurator Service.

Description Removes previously configured objects from the Log Configurator Service.

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.