Under 2.2.5 I was able to have batch processes send status information to the Server Log page of the Server Admin Console using application.output(). This output would also appear in the Terminal window from which the server was launched (under Mac OSX).
Under 3.0.2 I’m finding that the output appears in neither of these places. I have read about and fooled around with the various filters offered by the new log4j logging system but none of those filters bring up this output.
I could of course send the output to a db memo field or a text file and view it that way but the old way was quite handy. Does anyone know if it can still be done?
Thanks.
Adrian,
Put the following in your servoy.properties
log4j.logger.com.servoy.j2db.util.Debug=INFO
It is set to WARN by default filtering out INFO and DEBUG messages.
Value DEBUG gives you many debug messages, but application.output() is logged as INFO
Make sure that logging to the configservlet is enabled as well:
log4j.rootCategory=WARN, file, configservlet
This should make the application.output messages appear on the server page as well as in the log file.
Rob
Just switching the rootCategory setting to INFO made it so the application.output() goes to the server log and the server_log.txt file. Thank you.
You also suggested I do this:
log4j.logger.com.servoy.j2db.util.Debug=INFO
but that doesn’t seem to make much difference. I still don’t get the output in the Mac OSX bash terminal window like I used to under 2.2.5 ![Crying or Very sad :cry:]()
Adrian,
Add stdout to the rootCategory property and the output will apear on the terminal.
log4j.rootCategory=WARN, file, configservlet, stdout
Rob
I tried adding stdout - no output is being sent to the terminal window.
(Note: I was careful to shut down the server before changing the properties file to ensure my changes wouldn’t get overwritten.)
Adrian,
Can you show me your log4j properties in the servoy.properties file?
Below are mine where it works.
Rob
$ grep log4j servoy.properties
log4j.appender.configservlet=com.servoy.j2db.server.SlidingWindowAppender
log4j.appender.configservlet.layout=com.servoy.j2db.server.servlets.Log4JHTMLTableLayout
log4j.appender.configservlet.layout.dateTimeFormat=yyyy-MM-dd HH\:mm
log4j.appender.configservlet.windowSize=1000
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=servoy_log.txt
log4j.appender.file.MaxBackupIndex=1
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d %p [%t] %c - %m%n
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%t] %c - %m%n
log4j.debug=false
log4j.logger.com.servoy.j2db.util.Debug=INFO
log4j.logger.wicket=WARN
log4j.rootCategory=WARN, file, configservlet, stdout
$
here’s mine:
log4j.appender.configservlet=com.servoy.j2db.server.SlidingWindowAppender
log4j.appender.configservlet.layout=com.servoy.j2db.server.servlets.Log4JHTMLTableLayout
log4j.appender.configservlet.layout.dateTimeFormat=yyyy-MM-dd HH\:mm
log4j.appender.configservlet.windowSize=1000
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=servoy_log.txt
log4j.appender.file.MaxBackupIndex=1
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d %p [%t] %c - %m%n
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%t] %c - %m%n
log4j.debug=false
log4j.logger.com.servoy.j2db.util.Debug=INFO
log4j.logger.wicket=WARN
log4j.rootCategory=INFO, file, configservlet, stdout
The only difference I see is in the last line I have INFO and you have WARN. I put INFO there based on advice from Jan Blok. I have also tried it with WARN and it doesn’t affect the output to stdout.
A related question: by changing these WARNs to INFOs will I still be able to see any warnings when I set the filter to WARN in the Server Log console page?
Thanks for your help with this.
Adrian,
Can you try the latest 3.1 version?
I tried your log4j settings in 3.1 (on a mac) and application.output() does show on the console.
Rob