Posts tagged "weblogic"

Debugging LiveCycle – Working with logs (Part-1)

Ankush Kumar, Lead Software Engineer @ Adobe

Logs are the first thing that come to the mind when we run into an issue. Following are some tips on improving the logging on the application side as well as the application server side.

Enabling/Modifying Logging of Application Servers


JBoss

Jboss, which is bundled with LiveCycle has a pre-configured log4j configuration file. It is present as <Appserver Home>/server/<profile>/conf/jboss-log4j.xml. you can track new packages or existing packages at debug level by simply using the following command:

<category name=”com.adobe.mypackage”>

<priority value=”DEBUG”/>

</category>

From here, you can do the following configurations:

  • Change log file path
  • Change log entry structure
  • Specifying log rotation policy
  • Enable cluster logging

The following JBoss wiki can help you play around the logging file.

https://community.jboss.org/wiki/Logging


Weblogic

Weblogic logging can be configured from Weblogic administration console. There are separate administration consoles for each managed server. On Weblogic administration console, logging can be accessed at Environment > Servers > [Name of Managed Server or Admin Server] > Logging.

Here, you can define following configurations

  • Log file path
  • Rotation Policy

However, in the advanced section, you can define:

  • Log entry layout
  • Logging Level
  • Specify package level logging in “Logger Severity Properties” box:
    com.adobe.mypackage=Debug

Note that on Weblogic, if you are running into issues while deploying EARs, you may want to look into Domain logs and Adminserver logs. Both of these are created under <Weblogic Domain>/servers/<Admin Server>/logs.


Websphere

Websphere logs can be found at <Websphere Home>/AppServer/profiles/<Profile Name>/logs/<server name>. You can configure it from Websphere administration console at Websphere Application Servers > [name of server] > Logging and Tracing.

In JVM Logs, you can configure SystemOut and SystemErr logs for your server.

Here, you can configure:

  • Location of Log file
  • Rotation Policy

From Logging and Tracing, with few simple steps, you can enable the trace level logging for a specific package:

  1. Select “Change Log Detail Levels” from General Properties section.
  2. Under “Change Log Detail Levels” page, you can find a text box and tree beneath it with root node as “* [All Components] “.
  3. Expand Root node “* [All Components] > com.adobe.livecycle.*” and click “com.adobe.mypackage.*”.
  4. This will open a context menu. Go to Message and Trace Levels and choose finest from sub menu.
  5. Click Apply button and Save the settings to master configuration. Now you should be back to “Logging and tracing”.
  6. Select Diagnostic Trace link. This will open Diagnostic Trace Service page.
  7. Make sure File radio button is selected. Increase the Maximum File Size to 50 MB, and Maximum Number of Historical Files to 5.
  8. File Name text box shows “${SERVER_LOG_ROOT}/trace.log” by default. This means trace logs are getting created at default logs folder. You can change it by giving any absolute path where you want diagnostic logs to be written.
  9. Click Apply and Save the settings to master configuration.
  10. Restart the server. File specified at step 8 should get created.
VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 6.6/10 (7 votes cast)

Debugging LiveCycle – Working with Application Servers

- Ankush Kumar, Lead Software Engineer @ Adobe

Enabling Debugging

WebSphere

  1. Go to Websphere console -> Servers -> Application servers -> server1 -> Process Definition -> Java Virtual Machine.
  2. Enable the checkbox against Debug Mode.
  3. Fill in the following as debug arguments in the text box:
    Djava.compiler=NONE -Xdebug -Xnoagent
    -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777

Weblogic

  1. Go to Home >Summary of Servers >DocServer Server Start tab.
  2. Edit arguments and add:
    • For JRockit R28 and above -XX:
      agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8787
    • For others:
      Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777

JBoss

Add following in run.conf (for Non-Windows) and run.conf.bat/run.bat (for Windows):

  • Non-Windows: JAVA_OPTS=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n $JAVA_OPTS
  • Windows: set JAVA_OPTS=”-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n %JAVA_OPTS%”

Taking Thread Dump

If the server is started through a console/command line and not as a service, press a ctrl+z. The thread dump would be logged in the console window/console logs.

If the server is running as a service, do the following:

Windows

You can use a utility SendSignal. Follow the docs at this URL.

Unix

Identify the process id and then fire command

kill -3 <pid>

JBoss

Got to <jboss_home>\bin and execute following command:

twiddle.bat invoke “jboss.system:type=ServerInfo” listThreadDump > threaddump.html

Weblogic

For Weblogic 10 R3 you can use following way. Go to Weblogic Console -> Environment -> Servers On left side. Then select <your server> -> Monitoring tab -> Threads -> Dump Thread Stacks.

It will display the thread info.

Websphere 6

  1. Login to the machine where the WebSphere server is running.
  2. Open a command prompt and change directory to /WebSphere/AppServer/bin.
  3. Type wsadmin (will take a minute to connect – if authentication is enabled, it will prompt).
  4. Enter set jvm [$AdminControl completeObjectName,process=server1,*].
    • Replace server1 with the actual server you want to take a thread dump from (has to be local to this machine).
    • Enter $AdminControl invoke $jvm dumpThreads.

The thread dump is created in the profile folder for the server you created a dump for. There should be a “javacore.someText.txt” file created. If it’s a cluster, you’ll have to repeat the above steps for each server.

Websphere 7

Using JConsole. Connect the JConsole present in IBM JDK and trigger threaddump using that. You would have to follow the steps mentioned here for it to get to work.

Capturing SQL Logs

The SQL queries by UM can be logged using the default logging system for that system. Following two categories should be used:

  • com.adobe.idp.storeprovider.jdbc – Logs all the queries fired with the value populated.
  • storeprovider.stacktrace – This would also log the stacktrace of the thread which fired the query.

The logging level should be set to TRACE or the lowest for the queries to be logged. For the POF layer use the category com.adobe.pof.adapter for seeing the queries getting fired.

 

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 6.0/10 (1 vote cast)