OSX - Generating a real-time servoy log in a terminal window

On OSX, once Servoy Server is started, I’d like to see a real-time servoy log sent to a terminal window. I can do this with this command:

tail -F servoy_log.txt

I was wondering if there’s a way to integrate that command into the servoy_server.sh script so it becomes an automatic part of the server startup. My current servoy_server.sh script looks like this:

#!/bin/sh
cd /applications/servoy3.x_server; export DYLD_LIBRARY_PATH=/applications/servoy3.x_server/sybase_db; /Applications/Servoy3.x_Server/sybase_db/dbsrv9 @/Applications/Servoy3.x_Server/sybase_db/sybase.config&

while true
do
java -Djava.awt.headless=true -Xmx256m -Xms64m -classpath .:lib/commons-codec.jar:lib/commons-httpclient.jar:lib/activation.jar:lib/antlr.jar:lib/commons-collections.jar:lib/commons-dbcp.jar:lib/commons-fileupload-1.0.jar:lib/commons-logging.jar:lib/commons-pool.jar:lib/concurrent.jar:lib/dom4j.jar:lib/help.jar:lib/dbdialects.jar:lib/j2db.jar:lib/j2dbdev.jar:lib/jdbc2_0-stdext.jar:lib/jmx.jar:lib/jndi.jar:lib/js.jar:lib/jta.jar:lib/jug.jar:lib/log4j.jar:lib/mail.jar:lib/naming-factory.jar:lib/naming-resources.jar:lib/ognl.jar:lib/ohj-jewt.jar:lib/oracle_ice.jar:lib/server-bootstrap.jar:lib/servlet-api.jar:lib/wicket-extentions.jar:lib/wicket.jar:lib/xerces.jar com.servoy.j2db.server.ApplicationServer “$@” 1>> server.log 2>> server.log
EXITCODE=$?
if [ “$EXITCODE” != 99 ]; then exit $EXITCODE; fi
done

I don’t know shell scripting and my first two stabs at getting this to work achieved nothing. Any help appreciated.

Adrian, don’t you have output in your console?

I don’t know how to do this either, maybe ‘stdout’ instead of a filename?

This is for a udp packet processing application and it’s useful to see the log of incoming/outgoing packets in real-time. I do have output to my console (i.e. the log page of the admin console) but I have to hit refresh all the time to see if anything new has happened and that’s becoming a real pain.

Hi Adrian,

When the servoy_server.sh is launched at boot then anything send to stdout will go to /dev/null I believe.
Also when you launch servoy_server the log file might not be there yet and tail will fail, then again you could use sleep to let it wait between the commands.

What is wrong with just logging in with ssh and typing tail -F /path/to/servoy_log.txt ?
I do that all the time with all te other logs a server has.

Hope this helps.

If you append stdout to the following line in the servoy.properties file, all output is also written to the console:

log4j.rootCategory=INFO, file, configservlet, stdout

Paul