websphere : high performance extensible logging

14
By Joseph Amrith Raj WebSphere Application Server v8 Primer Chapter 7

Upload: josephs-websphere-library

Post on 16-Jul-2015

203 views

Category:

Technology


0 download

TRANSCRIPT

By Joseph Amrith Raj

WebSphere Application Server v8

Primer

Chapter

7

High Performance Extensible Logging 2

Joseph’s WebSphere Library

J O S E P H ’ S W E B S P H E R E L I B R A R Y

WebSphere Application Server v8

Primer, part-7: High Performance

Extensible Logging [HPEL]

WebSphere Library

http://twitter.com/WebSphere_Lib http://facebook.com/webspherelibrary

High Performance Extensible Logging 3

Joseph’s WebSphere Library

Table of Contents

1. What is HPEL ? ..............................................................................................................................4

2. Managing HPEL ..............................................................................................................................5

2A. HPEL Log Configuration .............................................................................................................6

2B. HPEL Trace Configuration ..........................................................................................................7

2C. HPEL Text log configuration ......................................................................................................8

3 .Verifying and viewing HPEL ............................................................................................................9

4 .Log viewer command-line tool ...................................................................................................... 11

4A .Some examples of using logviewer command ......................................................................... 11

Use of tail with logviewer ......................................................................................................... 11

Exporting only SysOut events to a readable log ......................................................................... 12

Exporting a log file between some dates ................................................................................... 12

About Author ................................................................................................................................... 13

Connect With US .............................................................................................................................. 14

High Performance Extensible Logging 4

Joseph’s WebSphere Library

1. What is HPEL ? HPEL – High Performance Extensible Logging, a new log and trace technology in WebSphere Application

server v8. It improves the performance of the log and trace as well as access to the data. HPEL provides

a convenient mechanism for storing and accessing log, trace, System.err, and System.out information

produced by the application server or your applications.

The information [logging/trace] from the HPEL is stored in binary format not the regular text format. You

can use the tools like logviewer to convert these logs to the readable text format.

HPEL provides different repositories for storing log and trace information.

A log data repository to store the log records from System.out, system.err,java.util.logging. Trace data

repository to store trace records. A text log file, for convenience of reading the log without using the log

viewer. You can disable the text log, if you are concerned about the performance.

Some important notes about HPEL

Every server process has its own set of repositories for logs, trace and text file. Hence there is

not sync activity between processes.

The data written to these repositories is not formatted for reading. In general, formatting data

requires some processing. So by not doing it, you are improving performance

By default, log and trace data is stored in an 8KB buffer before being written to disk. If the buffer

is filled within 10 seconds, the buffer is written to disk. If the buffer is not filled within that time

it is automatically written to disk to ensure that the logs have the most current information.

High Performance Extensible Logging 5

Joseph’s WebSphere Library

2. Managing HPEL

By default, HEPL is not enabled. To switch to this new logging system, navigate to Troubleshooting

logs and trace server and click on “Switch to HPEL mode”

After you switch to HPEL mode…

As you can see in the above screenshot, you can configure HPEL logging, HPEL trace and HPEL text log.

High Performance Extensible Logging 6

Joseph’s WebSphere Library

2A. HPEL Log Configuration

Directory path: directory where the logs will be stored/ repositories are placed

Enable Log record buffering: logs are first written to 8KB buffer before being written to the disk.

Start new log file daily at: log rotation policy

Log Record purging policies

o Begin cleanup of oldest records

When log size approaches max size - automatic log file cleanup to begin when

the total size of the log repository approaches the configured maximum size

When oldest log reaches age limit - automatic log file cleanup to begin when log

content is the age limit specified

When either age or size restriction is met - automatic log file cleanup to begin

when either of the previous conditions is met

Log record age limit: the lifespan, in hours, that log records can remain in the log repository

before the log records can be automatically deleted by the server

Max log size: maximum total size, in megabytes, that the server allows the log repository to

reach

Out of space action

Stop Server - server stops when the server is unable to write to the log repository

Purge old logs - server continues to run, and that the oldest log records are immediately

removed when the server is unable to write to the log repository

Stop logging - server continues to run, but that the server cannot continue to write to the

log when the server is unable to write to the log repository

High Performance Extensible Logging 7

Joseph’s WebSphere Library

2B. HPEL Trace Configuration

You can either write the trace data to a directory or to memory buffer. When using write to directory

option, the configuration options are same as those of HPEL log configuration, as explained above.

In the runtime tab of the Trace configuration, you find a Dump button when select trace to a memory

buffer option which writes the contents of the trace memory buffer to the trace directory.

Save runtime changes to configuration as well check box, when enabled.. Specifies that changes are

made to both the dynamic state of the running server, and the server configuration, which takes effect

on the next restart.

High Performance Extensible Logging 8

Joseph’s WebSphere Library

2C. HPEL Text log configuration

Apart from the configuration options explained in the HPEL log configuration section, you have 2

additional options here.

Text output format:

o Basic to specify a shorter, one-line-per-record format.

o Advanced to specify a longer format using full logger name and more details about each

record.

Include Trace records: Specifies whether trace records are included in the text log file, as well as

log records.

After all the configurations are done.. Save the changes and restart server.

High Performance Extensible Logging 9

Joseph’s WebSphere Library

3 .Verifying and viewing HPEL

I’ve marked 3 sections in the above screenshot to observe after HPEL is enabled and in action.

1. Go to the directory where the log records are being written and check the new HPEL log

directory structure.

2. In the administration console, click on the view HPEL logs and traces. Here you can select what

content you would like to see: SystemOut, SystemErr and log&trace. Also you can retrieve the

log data related to a particular time period. You can also export the log in binary format and

High Performance Extensible Logging 10

Joseph’s WebSphere Library

basic/advanced text log format. Also

3. If you want to switch back to the regular logging method.. you can click on “change log and trace

mode” option and then select switch back to Basic mode.

High Performance Extensible Logging 11

Joseph’s WebSphere Library

4 .Log viewer command-line tool

You can use the LogViewer command to query the contents of the High Performance Extensible Logging

(HPEL) log and trace repositories

Logviewer command has many optional parameters like RepositoryDir, format, outlog, start date,

stopdate etc.. [You can find the complete list of options on infocenter here]

You can also use the logviewer to view new log and trace repository entries as the server writes content

to them.

4A .Some examples of using logviewer command

Use of tail with logviewer

Note: when you run logviewer from the bin directory of the profile.. you don’t need to mention the

repository directory. Otherwise, you need to mention the optional parameter ‘repositoryDir’ on all

logviewer commands.

High Performance Extensible Logging 12

Joseph’s WebSphere Library

Exporting only SysOut events to a readable log

Exporting a log file between some dates

High Performance Extensible Logging 13

Joseph’s WebSphere Library

About Author

Joseph Amrith Raj is a technical consultant for multiple WebSphere products. He worked on various

product consulting and support teams including WebSphere Application Server, WebSphere MQ,

WebSphere Message Broker, Enterprise Service Bus and WebSphere Process Server. He has 7 years of

experience in administration, troubleshooting, consulting and he has significant experience in

architecture, strategy and leadership positions. He is IBM certified for WAS, WMQ, WPS , SOA and Cloud

Computing.

High Performance Extensible Logging 14

Joseph’s WebSphere Library

Connect With US

Get notified on upcoming tutorials

Subscribe, to get this WebSphere blog posts directly to your inbox : here

Tell us your feedback and what you want

Please leave your comments in the comments section below the post

Send us suggestions for future topics and improvements about the content at

[email protected]

Be Connected!

Connect with us on Facebook

Connect with us on Twitter

More about us : profile