Version 16.1 by David Avendasora on 2010/11/30 04:19

Show last authors
1 {{warning title="Peformace"}}
2
3 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.
4
5 {{/warning}}
6
7 ==== Logging for JavaMonitor and wotaskd ====
8
9 It is very useful to capture the JavaMonitor and wotaskd logs by adding the following to the .plist files in ##/Library/LaunchDaemons##. This is the preferred method of capturing log messages since it works even if JavaMonitor or wotaskd fail to launch.
10
11 Add this code to both of these files:
12
13 * **wotaskd**: ##/Library/LaunchDaemons/com.apple.webobjects.wotaskd.plist##
14 * **JavaMonitor**: ##/Library/LaunchDaemons/com.apple.webobjects.womonitor.plist##
15
16 {{code title="womonitor.plist and wotaskd.plist Addition"}}
17
18 <key>StandardOutPath</key>
19 <string>/Library/WebObjects/Logs/womonitor.log</string>
20
21 <key>StandardErrorPath</key>
22 <string>/Library/WebObjects/Logs/womonitor.log</string>
23
24 {{/code}}
25
26 {{note}}
27
28 The {{/Library/WebObjects/Logs}} 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 {{/Library/WebObjects/Logs}} directory. {{% ls -la /Library/WebObjects}} will show you.
29
30 {{/note}}
31
32 Now that log files are being written, turn on Deployment Debugging by adding these two ##<string>## elements to the ##<ProgramArguments>## element of womonitor.plist and/or wotaskd.plist:
33
34 {{code title="womonitor.plist and/or wotaskd.plist Addition"}}
35
36 <key>ProgramArguments</key>
37 <array>
38 ...
39 <string>-_DeploymentDebugging</string>
40 <string>true</string>
41 </array>
42
43 {{/code}}
44
45 Or, if you manually launch JavaMonitor and/or wotaskd, you can simply add ##-//DeploymentDebugging true//##// to your launch command.//
46
47 ##-//DeploymentDebugging//##// is the equivalent of passing all the following settings in either on the command-line or in a Properties file~://
48
49 {{code title="Deployment Debugging Properties"}}
50
51 NSLog.debug.setIsVerbose(true);
52 NSLog.out.setIsVerbose(true);
53 NSLog.err.setIsVerbose(true);
54 NSLog.allowDebugLoggingForGroups(NSLog.DebugGroupDeployment);
55 NSLog.debug.setAllowedDebugLevel(NSLog.DebugLevelDetailed);
56
57 {{/code}}
58
59 Which gives nice details like this :
60
61 {{code title="Log Example"}}
62
63 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
64 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
65 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
66 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
67 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
68 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
69 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
70 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
71
72 {{/code}}
73
74 ==== Logging Application Startup ====
75
76 Modify **SpawnOfWotaskd.sh** in ##/System/Library/WebObjects/JavaApplications/wotaskd.woa/Contents/Resources## 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.
77
78 {{code title="SpawnOfWotaskd.sh Logging Addition"}}
79
80 #!/bin/sh
81 # Modified by Mark Ritchie in Mar 2008
82 # - We now keep a log of any troubles while launching an application.
83
84 #$@ 1>/dev/null 2>&1 &
85 LOG=/Library/WebObjects/Logs/SpawnOfWotaskd.log
86 echo "************" >>${LOG}
87 echo "date: `date`" >>${LOG}
88 echo "args: $@" >>${LOG}
89 $@ 1>>${LOG} 2>&1 &
90
91 {{/code}}
92
93 {{warning title="Standard WebObjects Installs will Overwrite This Change"}}
94
95 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.
96
97 {{/warning}}
98
99 {{tip title="Don"}}
100
101 Consider installing JavaMonitor and wotaskd in {{/Library/WebObjects/JavaApplications}} instead of {{/System/Library/WebObjects/JavaApplications}}. 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.
102
103 {{/tip}}