IBM Support

Pranked by an unknown classfile? - Use Logging ConversionPattern to find out what class name is associated to a specific Maximo event.

Technical Blog Post


Abstract

Pranked by an unknown classfile? - Use Logging ConversionPattern to find out what class name is associated to a specific Maximo event.

Body

Sometimes you are working with Maximo and then you need to troubleshoot or have a better look at some specific event or process that is failing or not working as expected.  Your next step would be to check for what kind of failing event that is, and then try to find its associated classname in order to start your investigation about what the issue could be related to.
 
This applies to when you are testing a customization, or monitoring Maximo behavior even when the core classes are in place. But the current standard logging settings do not allow you the best way to view that information on the console or maximo log files themselves.
 
So, you may want to try something to make you log messages fit on a kind of template, to make our life easier in case we need to find out what is the specific classname and linenumber for a specific event we want to check.
 
You can follow the instructions below to add a special ‘NOTE’ to help you  find a classname being processed in Maximo, when an error happens for example, for better troubleshooting on maximo log files/console.  This will add more details to the Maximo log messages.
 
For Maximo 7.x,  you can perform that action on the Logging application, by updating the Conversion Pattern field from the Manage Appenders dialog box.  In the example below we just added %C and %L parameters  (related to classname and line number). 
 
Change the ConversionPattern to :
 
ConversionPattern=%d{HH:mm:ss} %-5p %m (%C %L) %n  
 
Also do it in the ConsoleAppender and RollingFileAppender 
 
NOTE :  You are free to add any text you want to serve as a reference.
 
 
This way, the log messages will show the class and the line where log was triggered.
 
Results in the log will be something as:   Example: 16:49:12 ERROR Hello logging! (psdi.app.actionscfg.Test 28)
 
Again, you are free to add any text you want to serve as a reference, for example :
 
CLASS NAME IS :  %C   LINE NUMBER IS   %L         or         CLASSNAME and LINE are :   %C and %L    etc…  etc…
 
In my example, we will add a different message, which will be YOU’VE BEEN PRANKED BY THE FOLLOWING CLASS %C %L.  
 
Results in the log will be something as: 
 
16:49:12 YOU’VE BEEN PRANKED BY THE FOLLOWING CLASS psdi.app.actionscfg.Test  2882
 
Just go the the Logging application and make sure you have the correct settings for this to happen:

 

image

image

 

image

 

image

 

And the results in the maximo.log file will display as something like :

YOU'VE BEEN PRANKED BY THE FOLLOWING CLASS psdi.server.MXServer 643206 Nov 2014 10:02:06:037 [INFO] [MXServer] [] BMXAA6370I - Total number of users connected to the system: 0

 YOU'VE BEEN PRANKED BY THE FOLLOWING CLASS psdi.server.CronTaskManager$MonitorThread 250706 Nov 2014 10:02:19:741 [INFO] [MXServer] [] BMXAA6378I - USER = (MAXADMIN) SPID = (128)BMXAA6379I - Application (CrontaskManager) :update taskscheduler  set servertimestamp =  ?  where servername =  ?  and taskname in ( ? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,?)

 YOU'VE BEEN PRANKED BY THE FOLLOWING CLASS psdi.mbo.MboSet 957406 Nov 2014 10:02:36:805 [INFO] [MXServer] [] BMXAA6719I - USER = (MAXADMIN) SPID = (133) app (null) object (MAXSESSION) : select * from maxsession  where maxsessionuid = 542 and (lastactivity is null or lastactivity != { ts '2014-11-06 10:00:34.786' })

 

And if you take a look in the console, you will see something like this, whenever you have a Maximo event happening.

image

This will help you to easily identify the classnames involved on a specific process.

 

Did you like this tip ?   Feel free to share this info.

In case you have any other Maximo related questions, please contact IBM Maximo Support, and we'll be happy to assist you !

Roberto P.

 

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSLKT6","label":"IBM Maximo Asset Management"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

UID

ibm11112997