简体   繁体   中英

Exception stack trace not appearing in WebSphere logs

Recently, I was given the task of enhancing a Java application deployed on WebSphere 6.0 in development and production environments. The code has a bug. It is accessing a database column by the wrong name. The code catches the exception, does a printStackTrace() and moves on.

In the development environment I see the stack trace of the exception in the WebSphere logs, but I do not see them in the logs for the production environment.

I do not have any admin privileges for WebSphere in the production environment. I can only see the log files. To ensure that I was running the same code in both environments, I obtained the EAR file from the production environment (from the group which manages the server) and deployed it to the development environment.

My question is, if I am running the same code in both environments, is it possible to see the stack trace in logs in one environment and not in the other?

Thanks

The environment is quite determinant for the behaviour of the whole system, so if you take an .ear file directly from a PROD environment, you surely could not deploy it on any other environment (such DEV or UAT) without doing several configuration changes, both in the .ear file and WebSphere.

Nevertheless, I think the problem here could be the log level configuration. Usually in lower environments we have a high log level configuration, as "all" or "finest", in orther to debug all the errors, so you can see many and different log inputs. In the other hand we have production environments, where the application should be running correctly after several tests in lower environments, so the log level is often reduced to "fatal", "severe" or "warning" to get only important errors and do not interfere with application/system performance. Check your log level configuration in both environments and compare them, it surely will be different (maybe you will have to ask for help to someone with admin privileges in production, at less if you want to change it).

Meanwhile, WebSphere 6.0 is out of support since 30 September 2010 ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM