|
From: Leif M. <lei...@ta...> - 2010-02-22 23:37:54
|
Ryan, The Wrapper's Event Log / syslog target is used to output the Wrapper's log output to the event log in addition to the wrapper.log and console. By default it is disabled. We do not recommend setting the Event Log's loglevel to DEBUG or INFO as it will very quickly fill up the event log. It is mainly useful for logging warnings and error messages. Normally, all output to the JVMs console will be logged by the Wrapper at the INFO log level. You can log to a higher level like ERROR or FATAL, but using the following API: import org.tanukisoftware.wrapper.WrapperManager; WrapperManager.log(WrapperManager.WRAPPER_LOG_LEVEL_ERROR, "This is a test Error"); See the Javadocs here: http://wrapper.tanukisoftware.org/doc/english/javadocs.html?org/tanukisoftware/wrapper/WrapperManager.html This output will then show up everywhere that the ERROR log output is enabled. On UNIX platforms it could go to the syslog. http://wrapper.tanukisoftware.org/doc/english/prop-syslog-loglevel.html http://wrapper.tanukisoftware.org/doc/english/prop-logfile-loglevel.html http://wrapper.tanukisoftware.org/doc/english/prop-console-loglevel.html http://wrapper.tanukisoftware.org/doc/english/props-logging.html What is an example of what you are trying to do? I may have some suggestions. Cheers, Leif On Mon, Feb 22, 2010 at 10:38 PM, Ryan Connolly <ry...@gm...> wrote: > Leif: > Thank you so much for the very detailed reply. I finally got the > logging working and as usual it was a silly mistake on my part: I had > neglected to call the NTEventLogAppender.setThreshold(Priority p) method. > Once I included that call, everything is working as expected. > > However, it would seem that using the built-in system logging would be much > cleaner (and platform independent) so I would be interested in getting that > working instead. Simply changing the wrapper.syslog.loglevel property value > from "none" to "info" or "debug" did not seem to work out. Is there > anything else I would need to do besides setting increasing the log level > there? > > Thanks again for the help! I was beginning to lose hope :) > -Ryan > On Mon, Feb 22, 2010 at 4:38 AM, Leif Mortenson <le...@ta...> > wrote: >> >> Ryan, >> The Java Service Wrapper has its own method of logging to the Windows >> Event Logs. It sounds like you have located the configuration for >> that. >> >> Log4J is an independent implementation that does not make use of the >> Wrapper's features. >> >> Looking at the following javadoc page, it says that it requires that >> you place a NTEventLogAppender.dll native library on the PATH. >> >> http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/nt/NTEventLogAppender.html >> When Java specifies a specific Library Path, as is done with the >> Wrapper, Java does NOT search the PATH by default. >> Please go in and either add the location of the NTEventLogAppender.dll >> file to the library path with the following property: >> >> http://wrapper.tanukisoftware.org/doc/english/prop-java-library-path-n.html >> Or tell the Wrapper to append the PATH again: >> >> http://wrapper.tanukisoftware.org/doc/english/prop-java-library-path-append-system-path.html >> I would suggest the first option. >> >> Another possibility is that your log4j properties file is not being >> found correctly when the JVM is launched. >> Please try setting the following property and rerunning your >> application to make sure that the Wrapper is generating the Java >> command line that you expect: >> wrapper.java.command.loglevel=INFO >> >> Please let me know how this works for you, or if you have more questions. >> >> Cheers, >> Leif >> >> >> On Sun, Feb 21, 2010 at 12:35 PM, Ryan Connolly <ry...@gm...> wrote: >> > Hello wrapper users! >> > I am new to the list so please take it easy on me. I'm sorry if this >> > has >> > been asked previously but I've had no luck finding any answers to my >> > question. I'm hoping y'all can help me out. >> > I have a requirement to perform some logging to the Windows Event Logs >> > and >> > I'm just not getting it... I've been using the log4j NTEventLogAppender >> > successfully in my unit tests however no logging occurs while running >> > from WrapperSimpleApp. I've noticed in the logging docs a >> > "wrapper.syslog.loglevel" property so I went ahead and changed its value >> > from NONE to INFO, still no dice. Does anyone have any additional >> > information or experience with this? I'd really like to get this sorted >> > out! >> > Thanks to any in advance! >> > -Ryan |