This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread 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 Android Security Essentials Live Lessons this week in the Android 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: 3476

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 ..
 
Similar Threads
Good logging system for WebApp (Struts)
Problem with logging
this and static don't mix
re: Java Logger Class
re: help appreciated