In some situations the trace information generated by the Java™ Persistence API (JPA) providers
shipped with WebSphere® Application
Server might not be adequate to diagnose a problem. In these situations,
an extended trace mechanism can be enabled to generate additional
information in the trace file. Extended trace can function only with
IBM-shipped persistence providers. It does not work with third-party
providers, including alternate versions of OpenJPA bundled within
an application or configured as a shared library.
About this task
Note: 이 주제는 하나 이상의 애플리케이션 서버 로그 파일을
참조합니다. 권장되는 대안은 분배 및 IBM® i 시스템에서 SystemOut.log, SystemErr.log, trace.log 및 activity.log 파일을 사용하는 대신
HPEL(High Performance Extensible Logging) 로그를 사용하고
인프라를 추적하도록 서버를 구성하는 것입니다. 원시 z/OS® 로깅 기능과 연계하여 HPEL을 사용할 수도 있습니다. HPEL을 사용하는 경우
서버 프로파일 바이너리 디렉토리의 LogViewer 명령행 도구를 사용하여
모든 로그에 액세스하고 정보를 추적할 수 있습니다. HPEL 사용에 대한 자세한 정보는
HPEL을 사용한 애플리케이션 문제점 해결 정보를
참조하십시오.
Enhanced
JPA tracing for an application running on WebSphere Application Server can be enabled
with a few simple steps using wsadmin scripting
or the administration console. The steps in this topic describe how
to configure enhanced tracing using the administration console. This
process changes server settings, so it is good practice to back up
your server configuration before proceeding.
Procedure
- Enable the trace agent. A trace agent must be
enabled per application server by passing an argument to the server Java Virtual Machine (JVM). The
trace agent can be enabled using the administrative console by following
these steps:
- In the navigation pane, select Servers.
Select Application Servers.
- In the server list pane, select the server that needs
the enhanced JPA trace. If multiple servers provide JPA functionality
to your application, these steps must be followed for every server.
- Under the Server Infrastructure heading, select Java
and Process Management. Select Process Definition.
- Under the Additional Properties heading, select Java
virtual machine.
- Add the following argument to the Generic JVM arguments
field, where <app_server_root> is
the fully qualified path of your application server installation directory.
Make sure to use the path separator character appropriate for your
operating system.
-javaagent:<app_server_root>/optionalLibraries/IBM/wsjpa/wsjpatrace.jar
Important: The use of generic JVM arguments in the administrative
console does not currently support spaces within arguments. If spaces
are specified in this field, the server can fail to start. This is
more likely to occur in a Windows environment
because the default installation path is C:\Program Files\IBM\WebSphere\AppServer,
which contains a space in the path. To work around this problem in
a Windows environment use
an abbreviated path name for the <app_server_root>.
For example, C:\Progra~1\IBM\WebSphere|AppServer.
On UNIX-type systems a symbolic link can be used to eliminate spaces
in the <app_server_root>.
For example, if the WebSphere Application
Server installation path is/opt/app_server_root/AppServer,
a symbolic link can be created in /opt from <app_server_root> to
AppServerRoot, eliminating the space. Then, specify /opt/AppServerRoot/AppServer as
the <app_server_root> in
the generic JVM argument.
- Enable additional trace components and adjust trace file
options. You can accomplish this step with wsadmin scripting
or the administration console. These steps describe how to adjust
trace file settings and enable components using the administration
console:
- In the navigation pane, select Troubleshooting.
Click Logs and Trace.
- Select the name of the server to trace.
- Under General Properties, select Diagnostic
Trace.
- Make sure Enable Log is checked
and optionally increase the Maximum File Size and Maximum
Number of Historical Files. Depending on the number of
additional trace categories and the trace levels chosen, the trace
file can become large.
- Under the Additional Properties heading, select Change
Log Detail Levels.
- Enable various extended trace categories by specifying
one or more trace categories from the following table. An example
trace string is: *=info:JPA=all:openjpa.*=finer:openjpa.kernel=finest.
Extended trace traces at the FINER or FINEST trace levels. The FINEST
level includes more detail than FINER. When ALL is specified, extended
trace traces at the FINEST level.
Table 1. Trace categories. Back up your server configuration before you enable enhanced
tracing.Category |
Relevant trace levels |
Description |
JPA |
OFF, ALL, FINER, FINEST |
Adds extended trace to the JPA trace group. |
openjpa.* |
OFF, ALL, FINER, FINEST |
Normal OpenJPA trace in addition to extended
trace for all categories in OpenJPA when extended trace is enabled. |
openjpa.xtrace.* |
OFF, ALL, FINER, FINEST |
Extended trace for all categories in OpenJPA
when extended trace is enabled. |
openjpa.xtrace.Jdbc |
OFF, ALL, FINER, FINEST |
Extended trace for OpenJPA JDBC classes when
extended trace is enabled. |
openjpa.xtrace.Lib |
OFF, ALL, FINER, FINEST |
Extended trace for OpenJPA library classes when
extended trace is enabled. |
openjpa.xtrace.Persist |
OFF, ALL, FINER, FINEST |
Extended trace for OpenJPA persistence classes
when extended trace is enabled. |
openjpa.xtrace.Kernel |
OFF, ALL, FINER, FINEST |
Extended trace for OpenJPA kernel classes when
extended trace is enabled. |
openjpa.xtrace.General |
OFF, ALL, FINER, FINEST |
Extended trace for OpenJPA classes not included
in the JDBC, Lib, Persist, or Kernel categories when extended trace
is enabled. |
openjpa.xtrace.ApiSpi |
OFF, ALL, FINER, FINEST |
Extended trace for public API/SPI interfaces
defined for WsJPA, OpenJPA, and JPA when extended trace is enabled. |
- Save the application server configuration and restart the
application server.
Results
After you restart the application server, the new trace settings
are used.
What to do next
문제점 방지: Tracing can degrade performance
significantly and should be disabled when not in use. To disable
trace, remove the Generic JVM argument and any trace detail levels
added for enhanced tracing.
gotcha