This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes Unable to log .. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Unable to log .." Watch "Unable to log .." New topic
Author

Unable to log ..

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Hey all.
I have the following code :

the problem is the logging is not working inside the constructor
(I mean, "server Object is created" is not been logged , while the
logging statement in the other methods of class Server is logged).
any ideas ?
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
I'm not sure about this one. logger may not really exist until the constructor finishes. (Usually we make class-level loggers a static variable.) If you really need it to be instance, just move the initialization into your constructor and then you should be fine. If you make it static, it will work as you currently expect.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to log ..