-
1. Re: JBoss Developer Studio 5 - console log output gone with "Run as Java Application" and using org.apache.commons.logging.LogFactory
maxandersen Aug 23, 2012 4:01 AM (in response to b.b.)There should not be anything changed here - the console output view should show up if the program is printing to the console.
a basic java main with a system.out.println("bla blah"); works for me.
If you can reproduce this in a basic java main project then let me know - but until then I would assume it is not because of change of JBDS version but more different in your program configuration or maybe java or OS version changes ?
-
2. Re: JBoss Developer Studio 5 - console log output gone with "Run as Java Application" and using org.apache.commons.logging.LogFactory
b.b. Aug 23, 2012 8:43 AM (in response to maxandersen)Hello,
the console output view *does* show up if the program is printing to the console.
a basic java main with a system.out.println("bla blah"); works also for me.
org.apache.log4j.Logger Objects work also for me.
What das not work for me and my team are Logger Objects of Type:
org.apache.commons.logging.Log;
org.apache.commons.logging.LogFactory;
What works and produces console output is usage of:
org.apache.log4j.Logger log = Logger.getLogger(LogTest.class);
What does not work and does not produce any output is usage of:
org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(LogTest.class);
...
log.info("ellou?");
log.debug("hu?");
log.error("eidonwonnadodat!");
...
As we do not want to redefine all logger item definitions directly to log4j classes and this behavior remains with jbdevstudio versions > 4 independent of what Java version or OSX Version, we assume it has to do with jbdevstudio.
Ah, did I mention OSX?
-
3. Re: JBoss Developer Studio 5 - console log output gone with "Run as Java Application" and using org.apache.commons.logging.LogFactory
maxandersen Aug 23, 2012 11:37 PM (in response to b.b.)I'm running on OSX - what I try works fine.
Can you create a minimal main class + pom.xml that reproduces this then I can investigate.
-
4. Re: JBoss Developer Studio 5 - console log output gone with "Run as Java Application" and using org.apache.commons.logging.LogFactory
b.b. Aug 24, 2012 2:09 AM (in response to maxandersen)//Here is a Java class to test this.
////////////////////////////////////////////////////////////////
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.Logger;
public class LoggerTest {
static Log logF = LogFactory.getLog(LoggerTest.class);
static Logger logJ = Logger.getLogger(LoggerTest.class);
public static void main(String[] args) {
System.out.println("LogFactory loggin");
logF.info("LogFactory?");
logF.debug("LogFactory");
logF.error("LogFactory");
System.out.println("LogFactory loggin end");
System.out.println("Logger loggin");
logJ.info("Logger");
logJ.debug("Logger");
logJ.error("Logger");
System.out.println("Logger loggin end");
}
}
////////////////////////////////////////////////////////////////
#Content of the file log4j.properties:
log4j.rootCategory=DEBUG, CONSOLE
# Stdout
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=DEBUG
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[%d{hh:mm:ss.SSS}]%5p - %C.%M:%L - %m %n
// the structure of the project for the test
My console output is:
LogFactory loggin
LogFactory loggin end
Logger loggin
[07:50:22.099] INFO - LoggerTest.main:25 - Logger
[07:50:22.103]DEBUG - LoggerTest.main:26 - Logger
[07:50:22.104]ERROR - LoggerTest.main:27 - Logger
Logger loggin end
-
5. Re: JBoss Developer Studio 5 - console log output gone with "Run as Java Application" and using org.apache.commons.logging.LogFactory
dgolovin Aug 29, 2012 3:28 PM (in response to b.b.)Tested the same code in clean JBDS 5 and it works for me in plain Java project with output:
LogFactory loggin
[12:23:15.589] INFO - LoggerTest1.main:15 - LogFactory?
[12:23:15.593]DEBUG - LoggerTest1.main:16 - LogFactory
[12:23:15.593]ERROR - LoggerTest1.main:17 - LogFactory
LogFactory loggin end
Logger loggin
[12:23:15.594] INFO - LoggerTest1.main:21 - Logger
[12:23:15.594]DEBUG - LoggerTest1.main:22 - Logger
[12:23:15.594]ERROR - LoggerTest1.main:23 - Logger
Logger loggin end
You have JBDS 5.0.0.GA, don't you?
-
6. Re: JBoss Developer Studio 5 - console log output gone with "Run as Java Application" and using org.apache.commons.logging.LogFactory
b.b. Aug 30, 2012 2:16 AM (in response to b.b.)JBoss Developer Studio
Version: 5.0.1.GA
Build id: v20120715-0533-H232-GA
Build date: 20120715-0533
but did not work with 5.0.0 either.
Thx for the information
-
7. Re: JBoss Developer Studio 5 - console log output gone with "Run as Java Application" and using org.apache.commons.logging.LogFactory
dgolovin Aug 30, 2012 12:55 PM (in response to b.b.)1 of 1 people found this helpfulI updated JBDS 5.0.0.GA to 5.0.1.GA and tested again, no problems on my side.
Could you import logTest project attached to https://issues.jboss.org/browse/JBDS-2258 as maven project and try if it works for you?
-
8. Re: JBoss Developer Studio 5 - console log output gone with "Run as Java Application" and using org.apache.commons.logging.LogFactory
b.b. Aug 30, 2012 1:24 PM (in response to dgolovin)Thank you for your input, it made me use a fresh workspace.
And there it all works fine.
The logger problem must results from a workspace we created with a JBDS 4.x version and opened and converted with a JBDS 5.x version.
To ommit this trouble we will start with fresh workspaces and import the projects.
Thanks to all for their engagement.
-
9. Re: JBoss Developer Studio 5 - console log output gone with "Run as Java Application" and using org.apache.commons.logging.LogFactory
maxandersen Aug 31, 2012 3:16 AM (in response to b.b.)hmm - I can't imagine what difference a workspace could do in affecting log output to an external java program.
Did you try import the example above into that for you broken JBDS 4.x based workspace ? did that work/fail ?
-
10. Re: JBoss Developer Studio 5 - console log output gone with "Run as Java Application" and using org.apache.commons.logging.LogFactory
b.b. Aug 31, 2012 9:20 AM (in response to maxandersen)Hi,
unfortunately I did that 5 minutes ago.
And guess what, it worked.
Duhhh?
I can't imagine what difference a maven dependent project could do to the same test?
I added the same commons-logging and log4j libs in both projects, yours and mine.
-
11. Re: JBoss Developer Studio 5 - console log output gone with "Run as Java Application" and using org.apache.commons.logging.LogFactory
maxandersen Aug 31, 2012 10:30 AM (in response to b.b.)1 of 1 people found this helpfulsorry to hear you are still affected, but at least shown that its something different than JBDS 4 -> 5 change.
look for some configuration that might be different..
-
12. Re: JBoss Developer Studio 5 - console log output gone with "Run as Java Application" and using org.apache.commons.logging.LogFactory
b.b. Dec 26, 2013 6:25 PM (in response to maxandersen)secret revealed.
it is the JBoss Server Runtime library (JBoss 6.x Runtime) that makes the console output vanish - if added to a projects buildpath.
U can easily reproduce this.
-
13. Re: JBoss Developer Studio 5 - console log output gone with "Run as Java Application" and using org.apache.commons.logging.LogFactory
dgolovin Sep 18, 2012 5:00 PM (in response to b.b.)I can replicate it now, but I got lost JBoss AS 6.x deps and could not figure out the reason. I verified though that with JBoss AS 7.1 it works as expected.