• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java Logging API with JSF

 
Author
Posts: 587
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to use the Java Logging API with JSF, but I'm having problems keeping the loggers unique to the sessions.

I'm using unique file names (embedded dates), but whenever a new session is started, the messages are logged to all of the existing file handles.

I'm going to try to resolve the issue tomorrow... but was looking for a heads up as to the cleanest way to implement the Java Logging API with JSF.

Note: I actually, wish to have an application level logger as well... that should be easier.

Any advice or direction would be appreciated. Are there any good articles on Logging with JSF? Does a framework support a better logger (i.e. Seam)?

As you can see, I really haven't started my homework yet....

Any heads up though, would be appreciated.

Thanks,
Robert
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I usually use either the built-in Java logger or Log4J. There is nothing special about using them or any other logger with JSF.

If I understand you correctly, you wanted to log on a per-user basis. I've never had a need to do so - I log for the entire application, so all I do is invoke the factory and build a static and/or member logger for the classes I want to report on.

To route per-user, you'd probably have to do something like construct a logger manually and store it in a session object, then log to it. Shouldn't be very hard, just not something I've done.
 
Robert James Liguori
Author
Posts: 587
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where is the best place to invoke the factory for an application-level logger? Config file, application listener?
 
Tim Holloway
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just put this in the class I want to log.

reply
    Bookmark Topic Watch Topic
  • New Topic