Wiki source code of Troubleshooting wotaskd and JavaMonitor on OS X
Last modified by David Avendasora on 2010/11/30 06:35
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{warning title="Peformace"}} | ||
2 | The logging settings outlined on this page are intended to help you troubleshoot a problematic install. They are **not** intended to be used in a running, production environment. They will cause substantial performance degradation. | ||
3 | {{/warning}} | ||
4 | |||
5 | ==== Logging for JavaMonitor and wotaskd ==== | ||
6 | |||
7 | It is very useful to capture the JavaMonitor and wotaskd logs by adding the following to the .plist files in {{code language="none"}}/Library/LaunchDaemons{{/code}}. This is the preferred method of capturing log messages since it works even if JavaMonitor or wotaskd fail to launch. | ||
8 | |||
9 | Add this code to both of these files: | ||
10 | |||
11 | * **wotaskd**: {{code language="none"}}/Library/LaunchDaemons/com.apple.webobjects.wotaskd.plist{{/code}} | ||
12 | * **JavaMonitor**: {{code language="none"}}/Library/LaunchDaemons/com.apple.webobjects.womonitor.plist{{/code}} | ||
13 | |||
14 | {{code 0="xml" title="womonitor.plist and wotaskd.plist Addition"}} | ||
15 | |||
16 | <key>StandardOutPath</key> | ||
17 | <string>/Library/WebObjects/Logs/womonitor.log</string> | ||
18 | |||
19 | <key>StandardErrorPath</key> | ||
20 | <string>/Library/WebObjects/Logs/womonitor.log</string> | ||
21 | |||
22 | {{/code}} | ||
23 | |||
24 | {{note}} | ||
25 | The {{code language="none"}}/Library/WebObjects/Logs{{/code}} should already be owned by appserver so there shouldn't be any permissions troubles with writing the logs there. If the files fail to show up, double check the permissions on the {{code language="none"}}/Library/WebObjects/Logs{{/code}} directory. {{code language="none"}}% ls -la /Library/WebObjects{{/code}} will show you. | ||
26 | {{/note}} | ||
27 | |||
28 | Now that log files are being written, turn on Deployment Debugging by adding these two {{code language="none"}}<string>{{/code}} elements to the {{code language="none"}}<ProgramArguments>{{/code}} element of womonitor.plist and/or wotaskd.plist: | ||
29 | |||
30 | {{code 0="xml" title="womonitor.plist and/or wotaskd.plist Addition"}} | ||
31 | |||
32 | <key>ProgramArguments</key> | ||
33 | <array> | ||
34 | ... | ||
35 | <string>-_DeploymentDebugging</string> | ||
36 | <string>true</string> | ||
37 | </array> | ||
38 | |||
39 | {{/code}} | ||
40 | |||
41 | Or, if you manually launch JavaMonitor and/or wotaskd, you can simply add {{code language="none"}}-_DeploymentDebugging true{{/code}} to your launch command. | ||
42 | |||
43 | {{code language="none"}}-_DeploymentDebugging{{/code}} is the equivalent of passing all the following settings in either on the command-line or in a Properties file: | ||
44 | |||
45 | {{code 0="none" title="Deployment Debugging Properties"}} | ||
46 | |||
47 | NSLog.debug.setIsVerbose(true); | ||
48 | NSLog.out.setIsVerbose(true); | ||
49 | NSLog.err.setIsVerbose(true); | ||
50 | NSLog.allowDebugLoggingForGroups(NSLog.DebugGroupDeployment); | ||
51 | NSLog.debug.setAllowedDebugLevel(NSLog.DebugLevelDetailed); | ||
52 | |||
53 | {{/code}} | ||
54 | |||
55 | Which gives nice details like this : | ||
56 | |||
57 | {{code 0="none" title="Log Example"}} | ||
58 | |||
59 | 2009-08-09 21:45:14,938 DEBUG 7.67 MB/24.02 MB [WorkerThread0] logging.ERXNSLogLog4jBridge - @@@@@ Received Lifebeat: lifebeat AjaxExample2 leopards.macti.lan 2003 | ||
60 | 2009-08-09 21:45:15,027 DEBUG 7.71 MB/23.97 MB [WorkerThread2] logging.ERXNSLogLog4jBridge - @@@@@ Received Lifebeat: lifebeat AjaxExample2 leopards.macti.lan 2004 | ||
61 | 2009-08-09 21:45:25,324 DEBUG 7.76 MB/23.93 MB [WorkerThread15] logging.ERXNSLogLog4jBridge - @@@@@ Received Lifebeat: lifebeat AjaxExample leopards.macti.lan 2005 | ||
62 | 2009-08-09 21:45:25,497 DEBUG 7.8 MB/23.88 MB [WorkerThread3] logging.ERXNSLogLog4jBridge - @@@@@ Received Lifebeat: lifebeat AjaxExample leopards.macti.lan 2001 | ||
63 | 2009-08-09 21:45:25,542 DEBUG 7.85 MB/23.84 MB [WorkerThread6] logging.ERXNSLogLog4jBridge - @@@@@ Received Lifebeat: lifebeat AjaxExample leopards.macti.lan 2006 | ||
64 | 2009-08-09 21:45:25,602 DEBUG 7.89 MB/23.8 MB [WorkerThread10] logging.ERXNSLogLog4jBridge - @@@@@ Received Lifebeat: lifebeat AjaxExample leopards.macti.lan 2002 | ||
65 | 2009-08-09 21:45:25,617 DEBUG 7.94 MB/23.75 MB [WorkerThread9] logging.ERXNSLogLog4jBridge - @@@@@ Received Lifebeat: lifebeat AjaxExample leopards.macti.lan 2007 | ||
66 | 2009-08-09 21:45:35,144 DEBUG 7.98 MB/23.71 MB [WorkerThread1] logging.ERXNSLogLog4jBridge - @@@@@ Received Lifebeat: lifebeat JavaMonitor leopards.macti.lan 56789 | ||
67 | |||
68 | {{/code}} | ||
69 | |||
70 | ==== Logging Application Startup ==== | ||
71 | |||
72 | Modify **SpawnOfWotaskd.sh** in {{code language="none"}}/System/Library/WebObjects/JavaApplications/wotaskd.woa/Contents/Resources{{/code}} to make it capture logs to the same folder. This is very useful if your application won't launch when you start it with JavaMonitor. | ||
73 | |||
74 | {{code 0="none" title="SpawnOfWotaskd.sh Logging Addition"}} | ||
75 | #!/bin/sh | ||
76 | # Modified by Mark Ritchie in Mar 2008 | ||
77 | # - We now keep a log of any troubles while launching an application. | ||
78 | |||
79 | #$@ 1>/dev/null 2>&1 & | ||
80 | LOG=/Library/WebObjects/Logs/SpawnOfWotaskd.log | ||
81 | echo "************" >>${LOG} | ||
82 | echo "date: `date`" >>${LOG} | ||
83 | echo "args: $@" >>${LOG} | ||
84 | $@ 1>>${LOG} 2>&1 & | ||
85 | {{/code}} | ||
86 | |||
87 | {{warning title="Standard WebObjects Installs will Overwrite This Change"}} | ||
88 | This script gets overwritten each time you install an updated copy of WebObjects or packages which include WebObjects so keep a backup of it handy. | ||
89 | {{/warning}} | ||
90 | |||
91 | {{tip title="Don't Use the Standard Install Location"}} | ||
92 | Consider installing JavaMonitor and wotaskd in {{code language="none"}}/Library/WebObjects/JavaApplications{{/code}} instead of {{code language="none"}}/System/Library/WebObjects/JavaApplications{{/code}}. A standard install of WebObjects will not overwrite them in this new location, but it does require additional work to make sure everything knows about the new location. | ||
93 | {{/tip}} |