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

Unable to log ..

Hussein Baghdadi
clojure forum advocate

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.

I agree. Here's the link:
subject: Unable to log ..