IBM Support

Logging Dos and Don'ts

Technical Blog Post


Logging Dos and Don'ts


A few general tips for Logging

 1. Don't set the Maximo root level logger (log4j.logger.maximo) to DEBUG.  Remember log4j's settings are inherited hierarchically.  Having the root logger set to DEBUG means any loggers which is a descendent of it will be set to DEBUG, unless it is specifically set to something else.  The consequence of this is a huge amount of data being logged, which is never helpful in debugging a specific problem.

 2. Don't set the top level sql logger (log4j.logger.maximo.sql) to INFO unless you are really clueless about what objects you are targeting, or you intentionally want to cast your net wide.  Instead, set the sql logger specific to the object(s) to INFO only.  For example, if you'd like to see all sqls associated with the WORKORDER object, you can set the logger log4j.logger.maximo.sql.WORKORDER.WORKORDER to INFO.  That way you will see only the sqls for the WORKORDER object but not those for the other object.  Note that the format of the logger’s key is in the format of log4j.logger.maximo.sql.[SERVICENAME].[OBJECTNAME]. You can use the lookup for the Logger field in the Logging application to find the correct [SERVICENAME].[OBJECTNAME].

 3. Don’t set the exception logger (log4j.logger.maximo.exception) to DEBUG.  Setting this logger to DEBUG causes ALL exceptions that are ever thrown from Maximo to be logged.  Note that not all exceptions are errors.  A lot of exceptions are harmless and therefore ignored.  If all these exceptions are logged it causes more confusion than being helpful.

[{"Business Unit":{"code":"BU005","label":"IoT"}, "Product":{"code":"SSLKT6","label":"Maximo Asset Management"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":""}]