1

I'm working in an enterprise that have an update on their application everyday.

I did an update yesterday because I haven't done it for a while. But there's an huge problem for me, developper, now: the standard output on the Eclipse Console doesn't come anymore after a dozen of lines, and I don't udnerstand why.

Indeed, here's the output when the problem come:

[02/08/2016 10:27:21] Info : Reading /me/test.properties property file
[02/08/2016 10:27:21] Info : Reading /me/test2.properties property file
[02/08/2016 10:27:21] Info : Reading /me/test3.version property file
[02/08/2016 10:27:21] Info : Connection to NamingService on host server  with port 14010
-- listing properties --
org.omg.CORBA.ORBInitialPort=4444
org.omg.CORBA.ORBClass=com.sun.corba.se.internal.iiop.ORB
org.omg.CORBA.ORBInitialHost=server
org.omg.CORBA.ORBSingletonClass=com.sun.corba.se.internal.iiop.ORB
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/myDir/myFile.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/myDir2/myFile2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

And after that, I can't have normal output (and before I don't know but the fact that there is the Date and the hour is a good sign.

For example, if I do a little System.out.println("Hi") it's not printed. And believe me, in that project, there's a LOT of Debug output that's supposed to be printed.

If you know why or if you think you can help me,

Thank you, Clément.

Souin
  • 94
  • 1
  • 11

2 Answers2

0

In server settings-common tab check if allocate console is checked or not

You have to check the checkbox for getting the output in console

Rishal
  • 1,480
  • 1
  • 11
  • 19
0

SHORT ANSWER:

You will find your print console statements redirected into the logs. If they are not there is because standard output has been disabled. Use log.xxx to get info from your app.


LONG ANSWER:

Force console output redirect to logs OR just avoid it via general configuration is an usual behaviour. A lot of companies, senior programmers or technical managers avoid output per console to force developers to write / read all application messages via logs by redirecting or disabling standard output.

THEY DO BECAUSE...

...using standard outputs are a common mistake made by junior programmers.

WHY?

Because this avoid

  • bad programming techniques
  • lose of info when running in production
  • performance issues

HOW TO SOLVE IT?

Don't use standard outputs, use log.info, log.debug or what you need instead System.out or System.err.

Community
  • 1
  • 1
Jordi Castilla
  • 26,609
  • 8
  • 70
  • 109
  • I don't think that the output are in logs. But i'll enquire. How can I check my log4j configuration? :) – Souin Aug 02 '16 at 09:01
  • which IDE are you using? you get config from central or local? *I don't think that the output are in logs*. Why you think so? for me sounds like an usual behaviour.... or are in logs, or they are nowhere. **you should't use `System.out` in big projects** so senior programmers avoid it. About log4j config it depends, first of all, check your logs, if you cannot find `Hi` try executing `log.info("HI");` after `System.out.println("Hi")` and check again – Jordi Castilla Aug 02 '16 at 09:06
  • 1
    Found it! Thank you, a lot :) Good continuation – Souin Aug 02 '16 at 09:13
  • glad to hear that... You will get used to it, this is a typical way of working, and you will see is more effective (at least when working with more people) – Jordi Castilla Aug 02 '16 at 09:15
  • Yes, i'm sure it's better. But why it's redirected in a log file whereas it was in Console, before? (without an update or modification of the code). Do you think the LSF4J binding can be the problem? – Souin Aug 02 '16 at 09:18
  • 1
    And once again, thank you. I found why this was redirected. They put a "appName.log.dir=xxxxx". My bad. – Souin Aug 02 '16 at 09:28
  • 1
    @Souin yes... central configuration!!! better don't change or will be reverted in next update. Just start logging, for more info, take a look at one of my preferred answers in SO http://stackoverflow.com/a/2031209/3850595 – Jordi Castilla Aug 02 '16 at 09:41