Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to log ..

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic