-
1. Re: Logging being intercepted from stdout and being logged at the trace level
jaikiran Feb 18, 2013 5:22 AM (in response to gavintranter)Gavin, welcome to the forums!
Which logging library are you using in your application? What exactly does your code (including the import statements for the logging library) look like?
As for the mismatch between the logging levels, perhaps this is relevant https://community.jboss.org/wiki/UsageOfLoggingLevels ?
-
2. Re: Logging being intercepted from stdout and being logged at the trace level
gavintranter Feb 18, 2013 5:33 AM (in response to jaikiran)Hi, thank you for the welcome
Logging library: log4j (1.2.16), slf4j seemes to be included in the libraries but I havent found any imports for it.
import: import org.apache.log4j.Logger;
init: static final Logger LOG = Logger.getLogger(AggregateDiagnosticsImpl.class);
usuage: LOG.trace("current stats :" + currentStats);
Its pretty standard really. In our newer webservice based apps we do tend to use slf4j rather than log4j directly, but while it is included as a library I actual cant see it being used.
Will check out the link.
Thanks
-
3. Re: Logging being intercepted from stdout and being logged at the trace level
jaikiran Feb 18, 2013 5:40 AM (in response to gavintranter)I forgot to ask. Which exact version of AS7 is this?
-
4. Re: Logging being intercepted from stdout and being logged at the trace level
gavintranter Feb 18, 2013 5:44 AM (in response to jaikiran)Ah, yeah that might be helpful, its 7.1.2.Final
-
5. Re: Logging being intercepted from stdout and being logged at the trace level
gavintranter Feb 18, 2013 6:14 AM (in response to gavintranter)Adding sample problem log output taken from server.log
14:49:16,330 INFO [|] [stdout] (task-scheduler-1) 8075367 [task-scheduler-1] TRACE net.blah.system.diagnosis.AggregateDiagnosticsImpl - reporting stats tt: 2899 ept:1359
(redacted the package name to protect the guilty )
So, as can be seen we have a TRACE level message being logged to stdout, which in turn is being intercepted by AS 7 logging and written to the log file. So each log statement is in effect being logged and written twice, once to stdout then being intercepted and rewritten to the server.log file.
-
6. Re: Logging being intercepted from stdout and being logged at the trace level
gavintranter Feb 18, 2013 8:44 AM (in response to gavintranter)Ok, we seem to have solves this by making the log4j library "provided" in the POM file.