How do you redirect output from a VisiBroker Server to a log file when it is started with the OAD on UNIX?
Question:
How do you redirect output from a VisiBroker Server to a log file when it is started by the OAD on UNIX?
Answer:
To use I/O redirection to capture the output of your server when it is started with the OAD you need to use a script file. For example, here is how to start the account_server from the account example:
1) Create a script file to launch the server:
#!/bin/ksh
# File foo.ksh
# Launch the account_server with output logged to a file
echo "exec /visibroker/examples/account/account_server $@ >> Logfile 2>&1" > Logfile
exec /visibroker/examples/account/account_server $@ >> Logfile 2>&1
2) Register the script file with the OAD using the acount_server interface
oadutil reg -r IDL:Account:1.0 -o "Jack B. Quick" -cpp /visibroker/examples/account/foo.ksh
3) Launch the client
account_client
The balance in Default Name's account is $168.38
4) Check the log
cat Logfile
Article originally contributed by Borland Developer Support