Date Created: Sun 25-Nov-2007

Related Document Categories:

Get my WebSphere Application Server course here >> http://www.themiddlewareshop.com/products/


    Web-based log viewer for IBM WebSphere 6.x

    WAS Log View version 1.5

    This Log Viewer application is designed to allow anyone web access to WebSphere logs using a Web Browser. It is very useful for test and development environments where you wish to give other people access to your WebSphere logs, but not a an OS level.

    If you have a clustered environment then you must install the application on each node. I have given the application as EAR file (The ear is defaulted to context logview for a single server), so the installer will not prompt for context root. This design keeps the code, installation and use simple.

    EAR file

    LogViewEAR_v1_5.ear

    Project Interchange RAD 7.0 - Source Code.

    LogView_v1_5.zip


    To use a third party application to scan the logs, you open a log using the raw option and copy the full URL as displayed.

    The application code is designed to use the server JVM properties to define several key folder locations. If you look into the code you will see that there is also a class to allow a developer to recompile using physical properties file as opposed to server JVM properties. The source is attached and the application was written using RAD 6 until version 1.54, from version 1.5 the code is developed using IBM RAD 7.0 for WebSphere.

    Feel free to contact me and submit suggestions for improvement as the application is still in it's infancy.
    Note: This application should also work in BEA WebLogic, though I have never tried.

    Installation Instructions:

    Below, is an example of deploying the log view application on node02 of a two node WebSphere ND deployment.

    Setting JVM properties of the server installed on a particular node.

    To run the application requires two JVM properties to function. one is the profiles.root property which determines the location of your WebSphere installation - profiles directory. The other is called log.folder, this is where you can set the location of your log files relative to the profiles root folder.










    install.root is not currently used by the application, it was part of a new feature to execute wasadmin tasks, but is not yet finished. I have not tested the application with it removed yet. You can not add it, if the application breaks then add it back.




    Deploying Application












    We do not map to IHS as we do not need Workload management for a log viewer.

    Map to appropriate node (do not use cluster)







    Start Application

    Example of how the application works

    The EAR file has set the context root to /logview

    open browser to appropriate port as defined by your virtual host definitions.










    Download - Download the file.
    Show file as HTML - Write the file to the browser, but make human readable by inserting <br> for each new line.




    Updates to come in further releases.

    1. Make JSP one single file as opposed to three separate jsp files.
    2. Update design template e.g update code to use relative CSS and enhance the UI interface.
    3. Change to MVC design. e.g Struts or Java Server Faces, most probably will be JSF, as i was just given a tutorial on JSF.
    4. Enable web execution of WebSphere command line utilities. Great for serverStatus.sh etc (have proven concept)
    5. Ensure Log4j is working properly - 50% done in version 1.4
    6. Add a readme. I suppose this document is a sort of readme.

    Answers to common questions:

    JVM Param Overview
    I am often asked why the application doesn't work. Most of the time it is due to a miss understanding of the two JVM parameters and how they are used.

    Here is a sample of typical settings for an install as follows:

    Lets say I have installed a profile called appsrv01 in was7 to the folder /apps/was7/profiles/appsrv01

    this means profiles.root = /apps/was7/profile this allows you to be able to drill down into multiple profiles if using more than one node.

    this means log.folder = logs as the default location from a profile is logs unless you change the WebSphere logging location.



    Log4j Debugging
    You can also turn on log4j debugging to help you resolve issue.

    If you go to <was_profile_root>/installedapps/<cellname>/Log Viewer.ear/LogView.war/WEB-INF/classes/com/websphere/utils and edit log4j.properties changing the following lines to DEBUG as opposed to ERROR. Restart Application. This will help you debug the problem by looking at you application servers SystemOut.log.

    # Print only messages of level DEBUG or above in the package com.websphere.utils.
    log4j.logger.com.websphere.utils=DEBUG

    # Print only messages of level DEBUG or above in the package .com.ibm._jsp._listprofiles
    log4j.logger.com.ibm._jsp._listprofiles=DEBUG

    Enjoy,

    Regards

    Steve Robinson - http://www.stevencharlesrobinson.com
    contact me

    Get my WebSphere Application Server course here >> http://www.themiddlewareshop.com/products/


Steve Robinson - IBM Champion 2013

About Me

Steve Robinson has been working in IT for over 20 years and has provided solutions for many large-enterprise corporate companies across the world. Steve specialises in Java and Middleware.

In January 2013, I was awarded the prestigous 'IBM Champion' accolade.


Read my books?

IBM WebSphere Application Server 8.0 Administration Guide

IBM WebSphere Application Server 8.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

WebSphere Categories

Other Categories