0

I have a application deployed on liberty profile that connects to a db server over the network. I'm trying to configure it so when connection time outs happen they are logged in messages or trace log files. At the moment it just gives me an output like Application xyz has not started in 30.004 seconds.

nothing to indicate why.... can anyone tell me how i configure it to output all DB related errors ?

blu10
  • 534
  • 2
  • 6
  • 28

1 Answers1

0

A failure to connect to a database should not be related to whether or not your application starts. As any database access defined by application code would be running after the application has reported that it started.

I suspect there is a separate issue causing your application to not start. To confirm this theory you can comment out database access from your application and see if the app starts then.

Andy Guibert
  • 41,446
  • 8
  • 38
  • 61
  • Im fairly sure it is related to the DB. When I give network access back to the Application is runs smoothly. When its dropped it fails to start. I can see logs in the logs/ffdc logs that indicate timeouts but i'd like these to be shown in the messages log – blu10 Oct 21 '16 at 15:01
  • the default trace spec `*=info` will make everything at INFO severity and up (Warning and Error) go to messages and trace. What is your trace spec set at? See this page for how to set trace in Liberty: http://www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/rwlp_logging.html – Andy Guibert Oct 21 '16 at 16:37
  • also, what are the timeouts you are seeing in the FFDCs? A stack would be helpful to understand why they might be impacting application start. To be clear -- are the timeouts expected? Are you trying to fix the timeout issues or just make your server tolerate them? – Andy Guibert Oct 21 '16 at 16:53
  • hey, sorry for delay getting back... Im basically trying to give users more info in the logs if there is a connection timeout... so thats what im simulating.. – blu10 Oct 24 '16 at 08:51
  • i've tried setting com.ibm.ws.logging.trace.specification=*=info:WAS.j2c=all:RRA=all:WAS.database=all:Transaction=all ... which does give more in the trace.log(its very verbose) but nothing to indicate a connection timeout The ffdc log gives this in the log, which is ideally what im trying to add to other logs Caused by: java.sql.SQLException: [jcc][t4][2043][11550][3.68.61] Exception java.net.ConnectException: Error opening socket to server xxxx on port 50,000 with message: Connection timed out: connect. ERRORCODE=-4499, SQLSTATE=08001 DSRA0010E: SQL State = 08001, Error Code = -4,499 – blu10 Oct 24 '16 at 08:52
  • have you also checked messages.log? That will show any FFDC's that occur, and the messages.log is significantly less verbose than trace.log. Also, does your solution depend on parsing log files? Wouldn't it be better to catch the exception in your application code and process it there to display it to the user? – Andy Guibert Oct 24 '16 at 14:03
  • yes i have, it doesnt show any errors like that at all .... no parsing log files in the solution needed, just want to log when the application fails to connect to the DB which it tries when starting up? – blu10 Oct 24 '16 at 15:31